|
-
Oct 26th, 2005, 04:17 PM
#1
Thread Starter
yay gay
Using div?
Hello, I have a webpage where i want to have some kind of text that should change when i click on a picture. I thought of using div's and then using its innerHTML property to set the text to the new value but it is not actually working.
function LOL(teste) {
var div = document.getElementById(teste);
div.innerHTML = "blablabla";
by some stupid reason it works on IE but in firefox it will change and in the same moment will change back to the old value. Any ideias why or how to do this in another way? Thanks in advance
\m/  \m/
-
Oct 28th, 2005, 07:10 AM
#2
Lively Member
Re: Using div?
How are you calling the function? This seems to work for me:
Code:
<html>
<head>
<script type="text/javascript">
function WriteText(el)
{
var div = document.getElementById(el);
div.innerHTML = "blablabla";
}
</script>
</head>
<body>
<img src="http://vbforums.com/images/misc/subscribed.gif" onclick="WriteText('boo');" width="15" height="15" border="0" id="xxx">
<div id="boo">
aasl;dkfjas;ldfkasd
</div>
</body>
</html>
Good luck;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|