I wrote the following HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Test</title>
<script type = "text/javascript" src =
"../js/test.js"></script>
</head>
<body>
<p><input type = "button" value = "Click";></input></p>
</body>
</html>
and the corresponding JavaScript file test.js
var inputs = document.getElementsByTagName("input");
console.log(inputs.length);
and the value shown is 0. Can anyone explain?
` even though `
` would work. This is just what I've heard. – Addem Feb 11 '17 at 17:58