[thelist] Finding class

Peter-Paul Koch gassinaumasis at hotmail.com
Tue Jan 29 09:02:01 CST 2002


>Is there a way using DOM to find elements by their class e.g.(<td
>id="some_td" class="td_text">) ?

Not directly, though you could do

var x = document.getElementsByTagName('TD');
for (var i=0;i<x.length;i++)
  if (x[i].className == 'td_text')
    do something

>I am trying to modify font sizes depending on the browser used.

So you really want to change a line in the style sheet, setting the font
size to 14px instead of 12, for instance. See
http://www.xs4all.nl/~ppk/js/index.html?changess.html for the code you need.

ppk

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




More information about the thelist mailing list