Saturday, October 19, 2013

Access content of iframe using jquery



It's very simple and straightforward.

Lets say, your using iframe and hello.aspx page like




1. < iframe id="frametemp" height="20px" width="90px"> </iframe>

which contain some control likes



2. <div id="divDisplayBox" > Say, Hello world! </div>

you can use .contents() method to find the specific id and like

3. $('#frametemp').contents().find('#divDisplayBox').html();

Hope this will helps you, Put your comments/suggestion if any.



 

No comments:

Post a Comment