jQuery create new div with ID?

后端 未结 4 446
栀梦
栀梦 2021-01-22 03:29

I have form in my ASP.NET masterPage.master and if i click on submit it call some method from masterPage.master.cs file by ajax (i have it in update panel). But i want improve i

4条回答
  •  悲哀的现实
    2021-01-22 03:46

    All the answers are valid.

    Another way:

    HTML

    JQuery

    $('#container').append("
    ");

    Or:

     $('#container').append(createDiv('id', 'class'));
    
     var createDiv = function(newid, newclass) {
        return $('
    ', { id: newid, class: newclass, css:{ width: "100px", height: "100px" } }); }

提交回复
热议问题