On Mar 15, 8:47 am, "Jean-Sébastien" <jeansebastien....@gmail.com>
wrote:
Hello,
I'm using yahoo css template and designing application with ROR. I'd
like to access the elements with no explicit id (starred lines), and i
must not add some explicit id.
page['element_id'].removeClassName('yui-g')
<div id="yui-main">
<div class="yui-b">
<div class="yui-gf">*
<div class="yui-u first">*
<!-- YOUR DATA GOES HERE -->
</div>
<div class="yui-u">*
<!-- YOUR DATA GOES HERE -->
</div>
</div>
</div>
How can i access them? (find element_id on starred lines)
Many libraries (and the archives here[1]) include a
'getElementsByClassName' method or something similar that uses CSS-
style selectors and return an array of matching elements. Most also
allow a 'root' or starting element to reduce the search scope -
Firefox 3.0 will support it as a native method.
You'll end up with something like:
var div = document.getElementById('yui-main');
var yuiU = div.getElementsByClassName('yui-u')[0];
or maybe
var yuiU = getElementsByClassName('yui-main', 'yui-u')[0];
1. <URL:
http://groups.google.com.au/group/co...t=0&scoring=d&
>
--
Rob