Jquery Value Related

Source: Internet
Author: User

/* ("${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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.