on-internet
← Community

window.open auto resize height and width according to dynamic content

Stack Overflow ·

I'm passing the div value to a window.open popup that should resize height according to content, however when i used auto it just opens a new window. I tried this code but wouldn't work function openPopup() { var divText = document.getElementById("pass").outerHTML; var myWindow = window.open('', '', 'width=500,height=auto'); var doc = myWindow.document; doc.open(); doc.write(divText); doc.close(); }

Comments

Sign in or sign up to comment and upvote.

No comments yet.