Hi guys,
I would like to change the text in an anchor.
es.
from
<a id="idanchor">o ldtext</a>
to
<a id="idanchor">n ewtext</a>
I found that under Explorer, it is possible to do it as:
anchor = document.getEle mentById('idanc hor');
anchor.innerTex t = "newtext";
Under Mozilla, such anchor property is called "text", but if I write:
anchor = document.getEle mentById('idanc hor');
anchor.text = "newtext";
the Javascript console gives me the following error:
"setting a property that has only a getter"
it looks like the text property can only be read, but not written.
Do you know any other way to change the text anchor also under Mozilla?
Cheers
Daniele
I would like to change the text in an anchor.
es.
from
<a id="idanchor">o ldtext</a>
to
<a id="idanchor">n ewtext</a>
I found that under Explorer, it is possible to do it as:
anchor = document.getEle mentById('idanc hor');
anchor.innerTex t = "newtext";
Under Mozilla, such anchor property is called "text", but if I write:
anchor = document.getEle mentById('idanc hor');
anchor.text = "newtext";
the Javascript console gives me the following error:
"setting a property that has only a getter"
it looks like the text property can only be read, but not written.
Do you know any other way to change the text anchor also under Mozilla?
Cheers
Daniele
Comment