I'm trying to have some text in my page changed by clicking
a button. Googleing around I've discovered that innerText
doesn't work with every browser, so I've switched to
innerHTML. It works fine on IE and Opera, but nothing
happens on Firefox (just updated to version 1.0.4).
Any suggestions?
Thanks in advance! C.
....
<script type="text/javascript">
function changeText(newt ext)
{
text.innerHTML = newtext;
}
</script>
<p id="text">Old text</p>
<input type="button" onclick="change Text('New text')"
value="Change text" />
....
a button. Googleing around I've discovered that innerText
doesn't work with every browser, so I've switched to
innerHTML. It works fine on IE and Opera, but nothing
happens on Firefox (just updated to version 1.0.4).
Any suggestions?
Thanks in advance! C.
....
<script type="text/javascript">
function changeText(newt ext)
{
text.innerHTML = newtext;
}
</script>
<p id="text">Old text</p>
<input type="button" onclick="change Text('New text')"
value="Change text" />
....
Comment