Dynamically create buttons with Jquery

前端 未结 4 1808
旧时难觅i
旧时难觅i 2020-12-14 03:41

I need to create 10 buttons dynamically with Jquery and set the text on them to be 1 -10, and add the same click event to all of them.

Should I be using dom create e

4条回答
  •  青春惊慌失措
    2020-12-14 04:02

    
    $(document).ready(function() {
      for(i = 1; i <=10; i++) {
         $('

    Hope it helps

提交回复
热议问题