Hi- I'm a javascript retard, and i don't know if what I'm about to say even makes sense. I need to target something like this: <a href="javascript:functionname('value')">the link</a> to an iframe: <iframe src="#" name="iframe"></iframe> ========== Any ideas? Thanks in advance
If I understood well what you wanted, so this is that you want <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Iframe link</title> </head> <body> <p> <a href="#" onclick="javascript:document.getElementById('iframe').src = 'http://rubensargsyan.wordpress.com';">Link</a> </p> <iframe src="http://rubensargsyan.com" name="iframe" id="iframe" width="800" height="600"></iframe> </body> </html> Code (markup):
Hi- No, it needs to be formatted like this: <a href="javascript:setContext('context')">link text</a> needs to target the iframe by name, not src - as follows: <iframe name="iframe"></iframe> I tried this: <a target="iframe" href="javascript:setContext('context')">link text</a> Of course, it didn't work, unfortunately.