[Javascript] Code optimization

tedd tedd at sperling.com
Tue Aug 15 07:57:56 CDT 2006


At 2:37 PM -0400 8/14/06, Terry Riegel wrote:
>Ok,
>
>I figured out how to reference the IMG tag. Duh, the code was very 
>easy to change on that point. Now how to reference the text?
>
>
>for (iItem = 0; iItem < aItems.length; iItem++)
>{
>    // get array of images in the list item
>    var aImages = aItems[iItem].getElementsByTagName("IMG");
>    // apply behaviors to the image link
>    if (aImages[0])
>     {
>     aImages[0].onclick = jsOpenDir;
>     }
>}
>
Terry:

I'm looking for that as well. I'm thinking about using div's with 
attributes that start with a common prefix, like "txtParagraph1" and 
then building an array of them.

I just don't have the js skills to do it, yet.  :-)

tedd
-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the Javascript mailing list