<!DOCTYPE html> <html> <head> <script type="application/javascript"> window.onload = function() { document.getElementById("i") .setAttribute("width", 100); }; </script> </head> <body> <iframe src="data:text/html,<div style='position:fixed'>foo</div>" id="i" width="75" height="150"></iframe> </body> </html>