Click here to Skip to main content
15,746,534 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I want to load a HTML content in IFrame.
I tried "innerHTML" property of IFRame but failed to get a response.But the condition is I don't want to use the src attribute of Iframe

Please help me with proper guidance
Updated 10-Jan-11 17:39pm
Sunasara Imdadhusen 10-Jan-11 2:34am    
Load html content means will have to load HTML page in iframe? i will help you once you clear my thoughts.
Dalek Dave 10-Jan-11 4:25am    
Edited for Grammar and Readability.

You should be able to do this in the following approach:

var iframe = document.getElementById('IFRAME ID'); // Get the iframe using it's ID

iframe .src = '//Set URL here';
Share this answer
Sunasara Imdadhusen 10-Jan-11 4:21am    
Good answer!!
if u need to use the <a> tag ,then it will be as following :

<iframe id="myframe"></iframe>
   <a href="url" target="frameId">pageName</a>
Share this answer
Dalek Dave 10-Jan-11 4:27am    
Edited for code block.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900