A simple Dom interview question
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>DOM!!!</title> | |
</head> | |
<body> | |
<h1 id="one">Welcome</h1> | |
<p>This is the welcome message.</p> | |
<h2>Technology</h2> | |
<p>This is the technology section.</p> | |
<script type="text/javascript"> | |
var text = document.getElementById("one").innerHTML; | |
alert("text); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment