[Solved] How to get the details from an HTML


Create a DOM element and set it’s innerHTML to the HTML string you have, then you can parse it’s HTML component.

var _html="<html><body><p>1. Heat the butter<br/>2. Add the onions<br/></p></body></html>";
var el = document.createElement('html');
el.innerHTML = _html;

var _el = el.getElementsByTagName('p');
alert(_el[0].innerHTML);

solved How to get the details from an HTML