Monday, 15 August 2011

javascript - checked radiobutton on checkbox change event -


We have checked or unchecked all the radiobots on the checkboxes. If the checkbox is checked then all the radiobots also check and vice versa . Not working properly

  & lt; Input type = "checkbox" id = "check" /> Select all & lt; Br / & gt; & Lt; Input type = "radio" /> First & lt; Br / & gt; & Lt; Input type = "radio" /> Second & lt; Br / & gt; & Lt; Input type = "radio" /> Third & lt; Br / & gt; & Lt; Input type = "radio" /> Fourth & lt; Br / & gt; & Lt; Input type = "radio" /> Fifth & lt; / Div & gt; & Lt; Script & gt; Var IsCheck = false; $ (Document). Change (function () {if (IsCheck == false) {$ ("input [type = radio]"). Attr ("checked", true) ; IsCheck == true} and {$ ("Input [type = radio]"). Et ("check", false); IsCheck == false}})}};    

try it

  $ (document) .tt (" Check ", $ (" # check "). (": "" (":" Checked "));});});   



No comments:

Post a Comment