Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1825
  • Last Modified:

How to assign iframe src value at runtime using javascript

Dear All,

I am trying to assign iframe src value at runtime. but i was not able to do that. Please help me.


Thanks
Karups.  
0
karups_chennai
Asked:
karups_chennai
1 Solution
 
Lolly-InkCommented:
Here's a simple example of assigning the src value of the iframe using JavaScript:
<html>
<script>
   function assignSrc()
   {
      document.getElementById("iframeA").src = "http://www.google.com";
   }
</script>
<body onload="assignSrc()">
   <iframe id="iframeA" width="800" height="600">
   </iframe>
</body>
</html>

Open in new window

0
 
karups_chennaiAuthor Commented:
It is working now
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now