About input, as a front-end do not know is unqualified, after all, no one project will not be missing this label, in fact, most of the input tag is good to say, but the biggest problem is radio, checkbox this choice tag.
About the use of Radio,checkbox, now many people have abandoned the original input radio and checkbox to choose Other plugins, undoubtedly this is a clever and easy way, but have to say that the greatest advantage of the original is flexible. So in some cases it will still be used.
<input type= ' Radio ' id= ' x ' name= ' x ' checked/>
Let's start with the question. When using the JQuery method to add the checked attribute to radio, there is no problem, but when the value of the Checked property is empty, there is a problem, the result radio is still selected state.
The problem is that when you add radio there will be a checked attribute, note that the checked attribute is the selected state, which does not require him to have any value when he is selected, so there is an error in using jquery to get the selected value.
The solution is also a concern when you need to use the code to control the selection, use the native checked property, or use the Add Delete attribute (not recommended), or choose the lazy dedicated jquery plugin
Well, if you encounter other problems in adding ....
This article is from the "Do Not Laugh" blog, please make sure to keep this source http://8779947.blog.51cto.com/8769947/1828703
About some pits in the radio tag (new issues will continue to be updated)