The example in this article describes how JavaScript gets and changes the input label Name property. Share to everyone for your reference. The implementation methods are as follows:
<input name= "KK" ></input>
<script language= "JavaScript" >
// Here use getElementsByTagName to get all the input objects out,
//This is the key to this problem, using Bytagname instead of byname.
var list = document.getElementsByTagName ("input");
Follow the bad collection, including all input.
var inputlist = document.getelementsbyname ("KK");
Test
for (i=0;i<list.length;i++) {
//Here is the pop-up is ' KK ', of course, can also output other according to need.
//For example: List[i].id List[i].value and so on.
alert (list[i].name);//This is to modify this value
list[i].name = ' mm ';//Then the pop-up is ' mm '
alert (list[i].name);
}
</script>
I hope this article will help you with your JavaScript programming.