How to create a radio button dynamically with jQuery?

后端 未结 8 1060
南方客
南方客 2020-12-08 22:25

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?

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 22:35

    I think this will serve your purpose:

    for (i = 0; i < 20; i++) {
        var radioBtn = $('');
        radioBtn.appendTo('#target');
    }
    
    

提交回复
热议问题