1. Use jquery
$("input[name='btnAdd']").attr("value")
Get the value attribute value, and the parameters of the other attributes replaced by attr are OK
2. Get it through the point:
<!doctype html><html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <form id="form1" name="form1"><input name="n1" type="text" /><input name="n3" type="text" /><input name="n4" type="text" /></form><script>window.onload = function(){ var inputs = document.form1.getElementsByTagName("input"); for(var i = 0; i < inputs.length; i++) { inputs[i].onclick = function(){ alert(this.name); }; }};</script> </body></html>The above is the full content of the method to obtain all the attributes of the input tag brought to you by the editor. I hope everyone will support Wulin.com more~