+ 1
How to relate its iframe element while working inside iframes document model in jquery like $(this).
https://code.sololearn.com/Wqm45bAbo5TU/?ref=app See this code .i want to change the background color of only single div which is sibling of iframe i am working .. using $(this) relationship .if blured on iframes body then it should reflect the change only to the div sibling of that iframe.. please somebody help me to solve this .. i have search for it but ots difficult to get it.. google only showing the results for getting data of iframe document but i want to excess the outer or parent elements which are siblings of a perricular iframe.. its not possible to give them diifffrent names as iframes will generate dinemically ..
6 Antworten
+ 1
Prakash
this == $( document.activeElement ) source - https://api.jquery.com/focus-selector/
https://code.sololearn.com/W5t0uVYVFAA0/#js
+ 1
Emma you are right in case of selecting index wise .. but it is about to change the background color of div directly sibling of the target iframe...
It can be done easily when event target is on iframe but now target is in the iframes body ..
My que is about how to get that iframe with relation to its body....
+ 1
Thanks a lot! ODLNT
+ 1
No problems, I'm glad I could help.