VladJ
VladJ

Reputation: 117

How can I change input value with jQuery?

I have this code:

<input type="checkbox" name="checkbox" id="radio1" class="radio" / value="1" />

I tried using jQuery:

$('#radio1').value=1;

Is this correct?

Upvotes: 0

Views: 47

Answers (1)

hmd
hmd

Reputation: 970

Just to show OP the correct HTML:

<input type="checkbox" name="checkbox" id="radio1" class="radio" value="1" />

JQuery:

$('#radio1').val(1);

Upvotes: 1

Related Questions