JQuery - get radio button value

<!DOCTYPE html>



<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>





         var radioValue = $("input[name='gender']:checked").val();


                alert("Your are a - " + radioValue);












<h1>Welcome to My Homepage</h1>

  <input type="radio" name="gender" id="gender" value=".bbb"> Male<br>

  <input type="radio" name="gender" id="gender" value=".bbb,.intro"> Female<br>

  <input type="radio" name="gender" id="gender" value="other"> Other

<p class="intro xxx bbb">My name is Donald.</p>

<p>I live in Duckburg.</p>


<div class="intro">My name is Dolly.</div>

<p>I live in Duckburg.</p>




jquery checkbox

To check on/off a checkbox:

To check if checkbox check on:

jquery dropdownlist

Get value of the selected item:


Get text of the selected item:

$("#ComboBox option:selected").text()

On select value change:

$("#ComboBox").change(function() { /* do something here */ });

Add item to the list:

$(“<option value=’new item’>new item</option>”).appendTo(“#ComboBox”);