The definition and usage of the id attribute:
This property can set or return the ID property value for the specified check box.
Syntax structure:
Checkbox.id=id
Description: The checkbox represents a CheckBox check box object.
Browser support:
This property is supported by the 1.IE browser.
2. Firefox supports this property.
This property is supported by the 3.Opera browser.
4. This property is supported by Google Chrome.
Instance code:
<!DOCTYPE HTML> <HTML> <Head> <MetaCharSet= "Utf-8"> <Metaname= "Author"content= "http://www.softwhy.com/" /> <title>Ant Tribe</title> <Scripttype= "Text/javascript">window.onload=function(){ varck=document.getElementById ("ck"); Ck.id="newid"; document.write (ck.id); } </Script> </Head> <Body> <formAction="#"name= "MyForm"> <inputtype= "checkbox"ID= "CK"value= "Ant Tribe/"></form> </Body> </HTML>
The above code sets the new ID property value for the check box and outputs it.
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=6705
JavaScript's Checkbox.id Property