How to use Radio Selector Method in JQuery

This article describe about Radio Selector Method in JQuery.
  • 1750

Use :radio Selector method in jQuery

We select specified input elements with type="radio".

This method select the radio type value for input element.

Example

<!DOCTYPE html>

<html>

<head>

<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">

    $(document).ready(function () {

        $(":radio").wrap("<span style='background-color:yellow' />");

    });

</script>

</head>

<body>

 

<form action="">

Name: <input type="text" name="user" />

<br />

Male:<input type="radio" name="sex" value="m" />

<br />

Female<input type="radio" name="sex" value="f" />

<br />

<input type="submit">

</form>

</body>

</html>

Output

op1.jpg

You may also want to read these related articles here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2019 DotNetHeaven. All rights reserved.