|Subject:||Need help using substringData()|
|Posted by:||Dudely (ab33…@gmail.com)|
|Date:||Thu, 28 Jun 2007|
I can't seem to get subStringData() to work. Can someone tell me what
I'm doing wrong and how to fix it?
Sample minimal code below. In case it's not obvious, foo() is meant
to be a generic function, capable of accepting any element with an id
that starts with the word "column", and followed by a number. So,
"column1", "column13", etc. The goal is to strip off the initial word
"column" and so be left with just the number as the resultant
For the record, I've spent many hours looking over the DOM model,
searching for examples, trying various things, etc. I still don't see
what I'm doing wrong.
// length of the string "column" is 6
// This one works
txt="<BR><h3>" + elmnt.id + " length=" + elmnt.id.length + "</h3>";
// So why doesn't this one?
<td id="column1" onMouseOver="foo(this)" ><a href="#" >Text1</a></td>
<td id="column2" onMouseOver="foo(this)" ><a href="#" >Text2</a></td>