"nutso fasst" <no********@no. where> wrote in message
news:db******** **********@news svr21.news.prod igy.com...
"tshad" <ts**********@f tsolutions.com> wrote in message
news:Ow******** **********@news svr21.news.prod igy.com... Is there a problem setting the span element?
A 'value' property on span does not display. The newly-created span
element
is empty and needs to have a text node appended.
var salaryMinLabel = document.getEle mentById("Salar yMin");
var sMLText = document.create TextNode("200")
salaryMinLabel. appendChild(sML Text);
alert("after setting salaryMinLabel = " +
salaryMinLabel. firstChild.node Value);
Works great.
Is there a way to create the child node at the beginning somehow?
The problem is that as I call this routine It creates another node each
time. I assume the next time I do the document.getEle mentById("Salar yMin")
the child node will still be there (since it was appended to the next time I
did it).
I am confused as to why or how it is working.
The 200 is showing on the screen, but when I do a viewsource, it isn't there
and doesn't seem to be anywhere on the page.
Here is the script from the viewsource of the page:
<script language="javas cript1.4">
function SalaryDisplay(m e)
{
alert("this.val ue = " + me.value);
var salaryMinLabel = document.getEle mentById("Salar yMin");
var sMLText = document.create TextNode("200")
salaryMinLabel. appendChild(sML Text);
SalaryMin2.inne rText = 200;
alert("after setting salaryMinLabel = " +
salaryMinLabel. firstChild.node Value);
}
</script>
Here is the html of the label (span):
Yea rly Compens:<span id="SalaryMin"> </span> /
<span id="SalaryMax"> </span>
As you can see there is no 200 there.
Thanks,
Tom