Nguyễn Hồng Yến
New member
What will be the output of the following JavaScript code?
A. head
B. true
C. false
D. 0
Code:
<p id="demo">head</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
var x = document.getElementById("demo");
x.innerHTML = x.attributes[0].isId;
}
</script>
B. true
C. false
D. 0