I have a scenario where a javascript function creates a new span element in web page present in main window of browser–
Code for this is given below–
document.createElement('span');
Now I want to extend this code to make it work in an iframe as well… I have figured out that for this to happen, the above code should be modified so that the span element is created within the iframe. I have with me the id/name of the iframe in which the span element has to be created… How do I create the span element in iframe?
I understand that the web page in iframe should belong to same domain as page contained in main window(viz Same Origin Policy)…
if i get u right u need to add an element in a page in iframe
use this code
Regards
Any Questions iam here
if my answer is useful please mark it as correct one