How to create div with class

后端 未结 5 452
感情败类
感情败类 2021-02-02 07:15

I\'m trying to create a div and give him a class but it doesn\'t work. Could anybody help me?

$(document).ready(function() {
$(\'input[type=checkbox]\').each(fun         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-02 07:47

    use "class" instead of className

    $('
    ', { "class": 'test', text: "a div", click: function(e){ e.preventDefault(); alert("test") }})

提交回复
热议问题