Jquery Check Radio - Pls Help

Moobs

Regular Member
Jan 30, 2015
270
23
I'm trying to make it so when a certain element is clicked this jquery script selects a specific radio. (should function the same as clicking the actual button)

#id is the id of the input just to be clear. I changed it to #id for this example.


Code:
<input type="radio" class="input-radio " value="cow" name="moo" id="id" />



$( ".selectionWrapper" ).click(function() {   
           $("#id").prop('checked', true);
                 
});
 
Solved

Code:
$("input[name=name][value='value']").prop("checked",true);
 
Glad to hear you fixed it!

Do you mind showing me the HTML (including the .selectionWrapper) in case there's a better way? For example, is it not possible to use a <label> in your particular case?
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock