javascript - JQuery Toggle only 1 item and the others not clicked -


OK, so this is a joke which will toggle some radio buttons on the page. I want it so much that when someone clicks on a radio button that others are not clicked, the way I currently have them can choose 3 at a time and I have a regular radio button that One click needs to be done and others are not

jquery:

  $ (function () {$ ('box-ul .btn. Dot. ') (Function () {$ (this) .toggleClass (' clicked ') ;.});});  

HTML:

  & lt; Div class = "box-ul box-video correct" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; Span class = "yes" & gt; & Lt; / Span & gt; & Lt; Easy to use & lt; P & gt / p & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; Span class = "yes" & gt; & Lt; / Span & gt; & Lt; P & gt; Step & step lt; Br / & gt; & Lt; Period & gt; Details of the & lt; / Span & gt; & Lt; / P & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; Span class = "yes" & gt; & Lt; / Span & gt; & Lt; P & gt; From setup time & lt; Br / & gt; & Lt; Period & gt; / Span & gt; For 30 minutes & lt under & lt; / P & gt; & Lt; / Li & gt; & Lt; Li class = "btn btn-expanded" & gt; & Lt; Div class = "btn-t" & gt; & Lt; Span class = "dot left" & gt; & Lt; / Span & gt; & Lt; P class = "left" & gt; Extended & lt; Br / & gt; & Lt; Span & gt; This is the expanding button, there is a little more space for this information. & Lt; / Span & gt; & Lt; / P & gt; & Lt; Div class = "cl" & gt; & Amp; Nbsp; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Li & gt; & Lt; Li class = "btn" & gt; & Lt; Div class = "btn-t" & gt; & Lt; Span class = "dot left" & gt; & Lt; / Span & gt; & Lt; P class = "left" & gt; Green Dodge & lt; / P & gt; & Lt; Div class = "cl" & gt; & Amp; Nbsp; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Li & gt; & Lt; Li class = "btn" & gt; & Lt; Div class = "btn-t" & gt; & Lt; Span class = "dot left" & gt; & Lt; / Span & gt; & Lt; P class = "left" & gt; Email support & lt; / P & gt; & Lt; Div class = "cl" & gt; & Amp; Nbsp; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt;  

After

not all matching elements that are using class which you clicked for the first time, like this:

  $ ('. Box-ul .btn .dot'). Click (function () ($. 'Box-ul .btn .tot') .No (this) .removeClass ('click'); $ (this) .toggleClass ('click');});  

In this case we have all other mailing '. Box-ul .btn .dot ' elements, with whom we clicked, and are doing it on them. The last part is still one so you can also choose by clicking on an active one. If you want to be able to de-select not (and also like a radio button) just to change it.


Comments