I need a return count of elements for example name "A"
<div id="box">
<input name="A" value="123">
<input name="A" value="456">
</div>
<script type="text/javascript">
var ii = document.getElementById("box");
var hh = ii.getElementsByName('A');
alert(hh.length); // should return 2 but return TypeError
</script>
result: TypeError: ii.getElementsByName is not a function
Thanks for helping!!
Copyright Notice:Content Author:「Korty」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50600399/html-javascript-get-length-name-in-div