How to create div with class

后端 未结 5 453
感情败类
感情败类 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:35

    $('input[type=checkbox]').each(function() {
    
    $(this).after('
    ').addClass('test') .filter('div').html('a div') .click(function() { alert('Handler for .click() called.'); }).end() .appendTo('this'); });

    Should work :)

提交回复
热议问题