Suppose there is such a structure

<div id="image"> <img src="..." /> Text </div> 

So we must leave the picture without text. Tell me how it can be done with javascript.

    1 answer 1

     var d = document.getElementById('image'); d.innerHTML = d.innerHTML.match(/<img[^>]+>/ig); 
    • 2
      If it helps, click the checkbox to the left of the answer so that the question does not hang in the unanswered. - Sh4dow