Dynamically setting div id in JavaScript or jQuery

后端 未结 8 1840
夕颜
夕颜 2020-12-15 11:43

How to set the div id dynamically? Here is my code:

<
8条回答
  •  北海茫月
    2020-12-15 12:08

    $('#q1').attr('id', 'q4') it soulde work I think...

    EDIT:

    If it still doesnt work try put this before :

    
    
                                     
                  
提交回复
热议问题