Skip to content

Instantly share code, notes, and snippets.

@sdoro
Last active January 14, 2018 15:13
Show Gist options
  • Save sdoro/d9eccda504eb938c201809b305cb6089 to your computer and use it in GitHub Desktop.
Save sdoro/d9eccda504eb938c201809b305cb6089 to your computer and use it in GitHub Desktop.
onmouseover
<h1 id="heading">Just a normal heading</h1>
<p>Followed by some normal paragraph text</p>

onmouseover

A Pen by Bre'Ana Deen on CodePen.

License.

Create an event handler that changes the text in the heading to "You moved the mouse over me" on a mouseover event.

var heading = document.getElementById("heading");
heading.onmouseover = changeHeading;
function changeHeading(){
heading.innerHTML = "You moved the mouse over me";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment