①document.getelementbyid sometimes catch name let go of ID, is said to be a bug of IE;
http://community.csdn.net/Expert/topic/4223/4223888.xml?temp=.1947443
On the page are
<input type= "hidden" id= "Hello8" name= "category_id" value= "2"/>
<select id= "category_id" >
One is Name= "category_id" one is id= "category_id"
Take the second one with document.getElementById, but the first one is taken name=category_id
In IE, getElementById is not the first catch ID but first find the same object name ...
Two form, each form has two textbox, the TextBox in the two form is the same name, but the ID is different ...
This is no problem in Firefox ... But in IE it only catches the first name information
The use of getElementById in ②javascript
The elements in a Web page must have an id attribute in order to get them through this method, such as
<input type=text name= "content" id= "Content" >
③ There are two main ways to get HTML tags, one is through the ID value, one is through the Name property
The Name property is used primarily for input tags within form forms
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.