jQuery is not picking up correct values from a Div Tag

Posted by Adi Mathur on Stack Overflow See other posts from Stack Overflow or by Adi Mathur
Published on 2011-01-14T16:26:29Z Indexed on 2011/01/14 16:53 UTC
Read the original article Hit count: 215

Filed under:
|
|
|
|

I want to pick up the values in a Div tag like which is some what like this

<html>
<head> </head>
<body>
<div id="page">
                <html>
                <head></head>
                <body> Hellow World </body>
                </html>
</div>
</body>
</html>

I want to select the content inside a div tag .

var msg = $("#page").html();
alert(msg);

this code is not working . i want that whole 2nd page along with the HTML tag is copied. How do i do that ?

I want the output to be the WHOLE thing INCLUDING the HTML tags

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery