I need to parse a html string to get a node in special, and discard others like script tags
For example I use this code;
//I get the htmlCode from a textArea
htmlCode = '<video>'+
'<source src="/media/video.oga">'+
'<source src="/media/video.m4v">'+
'<script src="evilscript.js"></script>'+
'</video>';
var div = document.createElement('div');
div.innerHTML = htmlCode;
And from there I can access the nodes of the div and discard the unnecesary; but I realize in network tab that the assignment launches requests of the sources of the video. And I don't want to make any request, because any malicious script can be in the htmlCode. So how could I modify the htmlCode without launching httprequests?
<script>elements are not evaluated when set viainnerHTML. w3.org/TR/2008/WD-html5-20080610/dom.html#innerhtml0