Sunday, September 6, 2009

Html checkbox is selected when click on text of checkbox

Select Checkbox when user click only on Checkbox button






Eg: < input type='checkbox' id='chkbox1' > < label > Apple < /label >

Select Checkbox when user click on label text and checkbox button






Description : Add for properties of lable and assing input id to for properties.
Eg: <  input type='checkbox' id='chkbox1' > <  label for='chkbox1' > Apple < /label >


Drop down list box with Group(HTML CONTROL)

Description:
Eg.  Syntax of  select box is
<select id="sexp1" >
<optgroup label='Group 1' >
<option value="1">item 1</option>
<option value="1">item 2</option>
</optgroup>
<optgroup label='Group 2' >
<option value="1">item 1</option>
<option value="1">item 2</option>
</optgroup>
</select>

2 comments:

  1. It is realy useful example to change the check status of the checkbox. Here "For" attribut is used for it.

    ReplyDelete
  2. thanks for such a nice help
    all the best and keep helping the people

    ReplyDelete