How can I create and style a div using JavaScript?

后端 未结 9 2294
野的像风
野的像风 2020-11-27 10:27

How can I use JavaScript to create and style (and append to the page) a div, with content? I know it\'s possible, but how?

9条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-27 10:50

    this solution uses the jquery library

    $('#elementId').append("
    content
    ");

提交回复
热议问题