Skip to content

Instantly share code, notes, and snippets.

@sdoro
Last active January 14, 2018 15:14
Show Gist options
  • Save sdoro/dd3bafabd452cf8c189afea9e2d7e27e to your computer and use it in GitHub Desktop.
Save sdoro/dd3bafabd452cf8c189afea9e2d7e27e to your computer and use it in GitHub Desktop.
innerHTML
<ul>
<li>salt</li>
<li>pepper</li>
</ul>
<p>Today is a <span id="day">bad</span> day</p>
var list = document.getElementsByTagName("ul")[0];
list.innerHTML += "<li>garlic</li>";
var day = document.getElementById("day");
day.innerHTML = "good";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment