I have 3 link images, which you're supposed to click, and then a caption will appear underneath, and also on a clickable button, which will take you to that site. All 3 go through the same button and caption, so it has to change based on which image you clicked. I am only allowed to use ONE function to make that work. So I did that, but it still doesn't do anything when I click the buttons.
I am NOT allowed to mess much with the structure - I must get ONE function of some kind to make all 3 of those linked images put out the 3 variables (caption, button, and target) depending on which image is clicked. I already made it work with 3 different functions, but now I have to do it with one.
I AM A TOTAL NEWBIE, so please show me how to do it as plainly as possible. thank you!
<html>
<head>
<script>
var caption1='My Blog';
var button1='My Blog';
var target1= 'http://iamunicorngirl.livejournal.com';
var caption2='Nail Polish Line';
var button2='Nail Polish Line';
var target2='http://mustachelacquer.etsy.com';
var caption3='Failblog';
var button3='Failblog';
var target3='http://failblog.org';
function ButtonFunction(caption1, button1, target3);
{
document.getElementById('linkbox').innerHTML=caption1;
document.getElementById('mybutton').innerHTML=button1;
document.getElementById('linkbox').setAttribute('onclick','window.location.href="'+ target3 +'";');
}
</script>
</head>
<table>
<table align="center">
<tr>
<td><img type="picture" src="blog.png" onclick="ButtonFunction(caption1, button1, target1)";></td>
<td><img type="picture" src="nailpolish.png" onclick="ButtonFunction(caption2, button2, target2)";></td>
<td><img type="picture" src="failblog.png" onclick="ButtonFunction(caption3, button3, target3)";></td>
</tr>
<tr>
<td><h3 type="text" id="linkbox"></h3></td>
</tr>
<tr>
<td><button id="mybutton"></button></td>
</tr>
</table>
</html>