0

here my code:

<div id="biography_name1">
    <iframe id="Array___Frame" src="some_value" height="600" frameborder="0" width="100%" scrolling="no" >
        <html>
              <head></head>
              <body>
                   <iframe  src="some_value">
                      <div class="my_value"> GET THIS VALUE </div>
                   </iframe> 
              </body>
        </html>
    </iframe> 
</div>

here i want to get class my_value values using jquery. how can i do?

Maulik patel
  • 1,551
  • 8
  • 22
  • 44
  • There seems to be no clean-cut way to do it, but [this should answer most of your questions](http://stackoverflow.com/questions/1654017/how-to-expose-iframes-dom-using-jquery). – faino Apr 09 '12 at 09:01

2 Answers2

0

Don't forget to upvote and accept an answer if it helps! ;)

<iframe id='frameParent'>
    <iframe id='frameChild'>
        <div id="my_value">some text here</div>
    </iframe>
</iframe>
<script>
    var foo = $("#frameParent").contents().find("#frameChild").contents().find(".my_value").text();
    //NOW YOUR VALUE IS STORED IN THE VARIABLE CALLED FOO  
    //change '#' to '.' in last find statement      
</script>

Now it should work

Muhammad Sannan Khalid
  • 3,127
  • 1
  • 22
  • 36
John Shepard
  • 937
  • 1
  • 9
  • 27
0
$(".my_value").text();

will do that.

me_digvijay
  • 5,374
  • 9
  • 46
  • 83