/* ("${feed.eleclean}" = = "1")? $ ("#cg1"). Hide (): $ ("#cg1"). Show ();
("${feed.elelight}" = = "1")? $ ("#cg2"). Hide (): $ ("#cg2"). Show ();
("${feed.opendoor}" = = "1")? $ ("#cg3"). Hide (): $ ("#cg3"). Show ();
("${feed.elelayer}" = = "1")? $ ("#cg4"). Hide (): $ ("#cg4"). Show ();
("${feed.elebottom}" = = "1")? $ ("#cg5"). Hide (): $ ("#cg5"). Show ();
("${feed.eleruncondition}" = = "1")? $ ("#cg6"). Hide (): $ ("#cg6"). Show (); */
/*** the first method directly through the three mesh operation to the value of input to hide and show good low ... three mesh operation donot if do not if ***/
$ (' input:radio:checked '). each (function () {
var rad=$ (this). Parent (). Parent ('. Control-group ');
if ($ (this). val () = = "1") {
$ (RAD). Hide ();
}
/*** the second method gets all the selected Radion, finds its parent class element
Get all selected Radion $ (' input:radio:checked ')
finds his parent class element $ (this) by the currently selected value . Parent (). Parent ('. Control-group ');
***/
/* var radd=$ (this). attr ("DATA-CG");
if ($ (this). val () = = "1") {
$ ("#" +radd). Hide ();
} */
});
/*** the third method by giving the input tag a custom attribute with the same name as the parent element ID
Determines whether the value of the currently selected radio is 1
The emphasis here is $ (this). Val () calls the method of jquery instead of value
***/
<div class= "Control-group" id= "CG1" >
<label class= "Control-label col-md-2 col-sm-2 col-xs-12" > Car sanitation is good:</label>
<div class= "Form-control required" style= "float:left;" >
<input type= "Radio" name= "Eleclean" id= "Eleclean" value= "1" disabled= "disabled"/> Yes
<input type= "Radio" name= "Eleclean" id= "Eleclean" value= "0" disabled= "disabled"/> No
</div>
</div>
<div class= "Control-group" id= "CG1" >
<label class= "Control-label col-md-2 col-sm-2 col-xs-12" > Car lighting is normal:</label>
<div class= "Form-control required" style= "float:left;" >
<input type= "Radio" Name=elelight id= "Elelight" value= "1" disabled= "disabled"/> Yes
<input type= "Radio" name= "Elelight" Id=elelight value= "0" disabled= "disabled"/> No
</div>
</div>
<div class= "Control-group" id= "CG1" >
<label class= "Control-label col-md-2 col-sm-2 col-xs-12" > Car opening and closing is normal:</label>
<div class= "Form-control required" style= "float:left;" >
<input type= "Radio" name= "Opendoor" id= "Opendoor" value= "1" disabled= "disabled"/> Yes
<input type= "Radio" name= "Opendoor" id= "Opendoor" value= "0" disabled= "disabled"/> No
</div>
</div>
<div class= "Control-group" id= "CG1" >
<label class= "Control-label col-md-2 col-sm-2 col-xs-12" > The flat level of the car is normal:</label>
<div class= "Form-control required" style= "float:left;" >
<input type= "Radio" name= "Elelayer" id= "Elelayer" value= "1" disabled= "disabled"/> Yes
<input type= "Radio" name= "Elelayer" id= "Elelayer" value= "0" disabled= "disabled"/> No
</div>
</div>
<div class= "Control-group" id= "CG1" >
<label class= "Control-label col-md-2 col-sm-2 col-xs-12" > Car button is normal:</label>
<div class= "Form-control required" style= "float:left;" >
<input type= "Radio" name= "Elebottom" id= "Elebottom" value= "1" disabled= "disabled"/> Yes
<input type= "Radio" name= "Elebottom" id= "Elebottom" value= "0" disabled= "disabled"/> No
</div>
</div>
<div class= "Control-group" id= "CG1" >
<label class= "Control-label col-md-2 col-sm-2 col-xs-12" > Car running is normal:</label>
<div class= "Form-control required" style= "float:left;" >
<input type= "Radio" name= "Eleruncondition" id= "Eleruncondition" value= "1" disabled= "disabled"/> Yes
<input type= "Radio" name= "Eleruncondition" id= "eleruncondition" value= "0" disabled= "disabled"/> No
</div>
</div>
Jquery Value Related