hello all,
i need to write a client side javascript code so when user clicks on a picture, that pictures disappears and a text appears instead.
Can anyone tell me how can this be done in javascript?
I'm not quite sure what you are trying to do with it.
Code:
<html>
<script>
function showtext(Text)
{
document.write(Text);
}
</script>
<body>
<img src="yourimage.jpg" onclick="showtext('<html><body>new text goes here<br>and can be formatted<b>etc.</b><br><br>end.');">
</body>
</html>
if you replace yourimage.jpg it will show a text if you click that image... but why can't you just link the description? I don't quite get it.
if you want to go the hard way, you can use css opacity to make the text show up - but this will require some more work