Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
100
rated 0 times [  101] [ 1]  / answers: 1 / hits: 18238  / 14 Years ago, fri, june 25, 2010, 12:00:00

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?


More From » jquery

 Answers
37
  <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();
}

[#96409] Monday, June 21, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ryanulyssesb

Total Points: 91
Total Questions: 105
Total Answers: 102

Location: England
Member since Tue, Sep 8, 2020
4 Years ago
ryanulyssesb questions
Sat, Mar 20, 21, 00:00, 3 Years ago
Mon, Sep 14, 20, 00:00, 4 Years ago
Mon, Mar 9, 20, 00:00, 4 Years ago
Sun, Jul 7, 19, 00:00, 5 Years ago
;