So basically I have something like this
<div class="iframe-holder"> <span></span> <iframe src="iframe.html" width="200" height="200" </div> <div class="iframe-holder"> <span></span> <iframe src="iframe.html" width="200" height="200" </div> <div class="iframe-holder"> <span></span> <iframe src="iframe.html" width="200" height="200" </div> <script> function where_am_i(iframe_parent_div,msg){ $(iframe_parent_div).find('span').html(msg); } </script>
and then in my iframe-holder.html I basically have this
<a href="#" id="msg">Show Message In Parent Div</a> <script> </script>
So basically, my question is how to target the parent div (div.iframe-holder) of the iframe instance that I click on the "Show Message" button on? Is it possible?
I know that I can pass through a source a variable with the index ie iframe.html? index = 0 for the first iframe.html? index = 1 for the second, etc., but this is not a viable solution for me because iframes will have a lot of navigation on different pages, therefore, going through all pages, the index is not an option.
source share