insert/remove HTML content between div tags

后端 未结 7 1952
渐次进展
渐次进展 2020-12-30 01:22

how can I insert some HTML code between

...
using javascript?

Ex:

相关标签:
7条回答
  • 2020-12-30 01:57

    Javascript

    document.getElementById('mydiv').innerHTML = '<span class="prego">Something</span>';
    

    jQuery

    $("#mydiv").append('<span class="prego">Something</span>');
    
    0 讨论(0)
提交回复
热议问题