Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

js onclick link question

Status
Not open for further replies.

smachez

Technical User
May 19, 2008
1
This should be pretty straightforward. Basically I just need to set a "default" link and then have it clear as each link is clicked, for example:


the current code that I have is simply:
function change_pic(val) {
document.getElementById('map_text_item').innerHTML = "<p align=\"center\" span class=\"caption\">"+val+"</p>";

but as you'll see on the page there is a problem

thx
 
[1] The function itself is fine, you have to take out the return false; statement in the onclick handler.
[2] What is the functionality you seem to anticipating from specifying two targets (apparently named one in uppercase one in lowercase)? I would take the one with value "_top" out.

><A HREF="images/right1.gif" target="FRAME1" TARGET="_top"
> onclick="javascript:change_pic('SOUTH AFRICA'); return false;">1</A>
[tt]<A HREF="images/right1.gif" target="FRAME1"
onclick="change_pic('SOUTH AFRICA');">1</A>[/tt]

Same for the other two.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top