Many times I would like to use the browser default radio button or check box, such as lazy or bad mood when ╮ (╯﹏╰) ╭,
In the HTML structure I would like to implement the radio button next to the text clicked and then select or vice versa, like this:
The HTML code can be written like this: <label><input type= "Radio"/>JAVASCRIPT</LABEL> the event is automatically associated with a label tag.
Then the question came, if it is more than one option, I would like to click on an option, the other is not selected by default, how to write, copy the above code paste a few lines changed the text on the line, if I do not write the following code, haha:
<label><inputtype= "Radio"name= "Options" />Javascript</label> <label><inputtype= "Radio"name= "Options" />Html5</label> <label><inputtype= "Radio"name= "Options" />Css3</label>
I need to associate them with the name attribute so that I can achieve the desired effect:
$ (' input[type=checkbox] '). Prop (' checked ') //< /span> get $ (' input[type=checkbox] '). Prop (' checked ', true ) // set $ (' input[type=checkbox] '). Prop (' checked ', False ) // set // alert (Document.queryselector (' input[type=checkbox] ' Span style= "color: #000000;" >). checked); Document.queryselector ( ' input[type=checkbox] '). Checked=true ; Document.queryselector ( ' input[type=checkbox] '). Checked=false ;
check box event:
Assuming that the check box on the page is selected, when clicking on a checkbox, is the first click event or the event that the checkbox turns true, it turns out that the browser defaults to the checkbox's checked to True, Then the click event of the checkbox is executed, so the ╭∩╮ (︶^︶) ╭∩╮ to write like this:
About check boxes and radio boxes