Javascript examples for String Operation:String Parse
Parse GET request string as HTML
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// w ww. ja va2 s . co m var htmlString = "<html><body><div class='class'>test!</div></body></html>" var htmlElem = document.createElement("html"); htmlElem.innerHTML = htmlString; console.log(htmlElem.getElementsByClassName("class")[0].innerHTML); } </script> </head> <body> </body> </html>