Nguyễn Thanh Uyên
New member
What will be the output of the following JavaScript code?
A. 0
B. hello
C. h2
D. 2
Code:
function counth2()
{
var totalh2=document.getElementsByTagName("h2");
alert("totalh2.length);
}
<h2>hello</h2>
<h2>hello</h2>
B. hello
C. h2
D. 2