I am developing a small application in which I want to create 20 radio buttons in one row.
How can I do this using jQuery?
This code will append radio buttons with unique id to each of them....
for (var i=0;i<=20;i++)
{
$("#yourcontainer").append("<input type='radio' id='myRadio"+i+"'>")
}
for (i = 0; i < 20; i++) {
$('<input type="radio" name="radiobtn" >Yourtext'+i+'</input>').appendTo('#container');
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="container"></div>