JavaScript RegEx for div tags

后端 未结 10 1130
旧巷少年郎
旧巷少年郎 2020-12-17 00:26

I have a JavaScript variable which holds an HTML page and due to the setup I need to extract everything between

and
10条回答
  •  遥遥无期
    2020-12-17 01:30

    I'm not sure I follow you when you say, "Javascript variable which holds an html page", but If you need to extract the HTML between such a div, you can use the element's innerHTML property.

    
    var e = document.getElementById('LiveArea');
    if(e) alert(e.innerHTML);
    
    
    

提交回复
热议问题