javascript innerHTML adding instead of replacing

前端 未结 6 1552
名媛妹妹
名媛妹妹 2020-11-30 04:32

quick question, i know we can change the content of a

hello one
by using:

docum         


        
6条回答
  •  悲&欢浪女
    2020-11-30 05:23

    You can do it by appending div string like this..

    document.getElementById('div_id').innerHTML += 'Hello Two';

提交回复
热议问题