Hello.
I have this question.
Is it possible to make a new tab open in the browser with the content specified in the textarea when clicking on the button? If so, write how.
I hope you understand the question;)
Hello.
I have this question.
Is it possible to make a new tab open in the browser with the content specified in the textarea when clicking on the button? If so, write how.
I hope you understand the question;)
If the user is configured to open in a new tab by default, he will open, and if not, he will open in a new window. Testing here
$('button').on('click', function(){ var win = window.open('', '_blank'); win.document.write('<html><head><title>Содержимое textarea</title>'); win.document.write('</head><body >'); win.document.write('<pre>' + $('textarea').val() + '</pre>'); win.document.write('</body></html>'); win.focus(); });
Source: https://ru.stackoverflow.com/questions/360116/
All Articles