how to add paragraph on top of div content

前端 未结 6 606
清酒与你
清酒与你 2020-12-09 15:28

How can I add multiple paragraph tag, newly tag on top within div container.

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 16:22

    An example for non jQuery-users:

    document.getElementById('pcontainer').innerHTML = '

    new paragraph

    ' + document.getElementById('pcontainer').innerHTML;

    maybe not as short and nice though :)

提交回复
热议问题