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?
I think this will serve your purpose:
for (i = 0; i < 20; i++) { var radioBtn = $('<input type="radio" name="rbtnCount" />'); radioBtn.appendTo('#target'); }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="target"></div>
1.4m articles
1.4m replys
5 comments
57.0k users