I want to convert my HTML string below in an HTML document. The code below works fine on Firefox and Chrome but not in other browsers (Opera, Safari, IE). Can you help me?
var content = '<iframe width="640" height="360" src="//www.youtube.com/embed/ZnuwB35GYMY" frameborder="0" allowfullscreen></iframe>';
var parser = new DOMParser();
var htmlDoc = parser.parseFromString(content,"text/html");
Thank you not to reply in JQuery.
I want to do exactly that, but in javascript
<?php
$content = '<iframe width="640" height="360" src="//www.youtube.com/embed/ZnuwB35GYMY" frameborder="0" allowfullscreen></iframe>';
$doc = new DOMDocument();
$doc->loadHTML($content);
?>
My main goal is to transform my HTML text in an HTML document in order to change the Width and Height properties of my iframe.