Let's say i have this code
<p id="test">
some content
<p>
<a href="#" id="test-link">Open</a>
Now i want -using javascript/jquery- to create a popup window, the window content is the content of test
paragraph, when test-link
is clicked.
How could this be done?
<a href="javascript:popup();" id="test-link">Open</a>
function popup()
{
var generator=window.open('','name','height=400,width=500');
generator.document.write('<html><head><title>Popup</title>');
generator.document.write($("#test").html());
generator.document.write('</body></html>');
generator.document.close();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With