Is there anyone who know how to AutoCheck, CheckBox in the code below either via css or Java - with the option to uncheck by clicking
<span id="ctl00_bc_custom_element_43" class="checkbox">
<input id="#ctl00_bc_custom_element_43_0" type="checkbox" name="ctl00$bc$custom_element_43$0">
<label for="ctl00_bc_custom开发者_如何学Python_element_43_0">Yes, sign me up!</label>
</span>
document.getElementById("ctl00_bc_custom_element_43").checked = true
You mean by giving the <input>
element the "checked" attribute?
<input checked='true' id="#ctl00_bc_custom_element_43_0" type="checkbox" name="ctl00$bc$custom_element_43$0">
<input id="#ctl00_bc_custom_element_43_0" type="checkbox" name="ctl00$bc$custom_element_43$0" checked="checked">
or in JS
document.getElementByID('#ctl00_bc_custom_element_43_0').checked = true;
document.getElementById('#ctl00_bc_custom_element_43_0').checked = true;
Change ByID to ById.
精彩评论