Skip to content

Instantly share code, notes, and snippets.

@sdoro
Created January 14, 2018 14:24
Show Gist options
  • Save sdoro/ddf89cfeb0cbcd93aa2bda36224c63a1 to your computer and use it in GitHub Desktop.
Save sdoro/ddf89cfeb0cbcd93aa2bda36224c63a1 to your computer and use it in GitHub Desktop.
onclick
<p id="myParagraph">Good Morning!</p>
var paragraph = document.getElementById("myParagraph");
paragraph.onclick = changeGreeting;
function changeGreeting(){
paragraph.innerHTML = "Good Night!";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment