Click here to Skip to main content
15,919,613 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HI

I am very new in web designing,I want to change source URL of
HTML
iframe
by user clicking.
Suppose user clicked Login link in main menu,and he see the Login form in block of site ,And also for other menu links...
here is my html code:

HTML
<li><a href="?"  id="iframe"  önclick="getURL();">Login</a></li>


and it's JavaScript code :

C#
function getURL() {
            var urlname = document.getElementById("iframe").getAttribute("href");
            $('iframe').attr('src', urlname);


but it didn't work correctly :
first: I do't know what set
HTML
href
in
HTML
iframe

and help in Javascript code...

Thank you ...:)
Posted
Updated 10-Mar-14 19:48pm
v2

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