473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

access the elements with no explicit id

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)

Thank you.

Mar 14 '07 #1
2 1662
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

Mar 14 '07 #2
On Mar 15, 12:24 am, "RobG" <r...@iinet.net.auwrote:
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...search?q=getEl...

--
Rob
thank you. i will try this.

Mar 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kenneth | last post by:
This is probably very simple question but how do you access elements inside the <div> tag? I need to access the value of a textfield inside a <div> tag. Thanks.
5
by: syntheticninja | last post by:
I am trying to loop through a form to get all the check boxes that exist on that particular form. My problem is the checkboxes are dynamically added to the page after it has loaded (using the...
12
by: Phil Powell | last post by:
<cfquery name="getAll" datasource="#request.dsn#"> SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn, U.choiceId, U.experience, T.label AS teamLabel, R.label AS roleLabel FROM User U...
1
by: Ana Lindt | last post by:
Hello, I remember reading in one of my books that it was possible to access some collection's elements with the dot (.) operator just like if they were properties. The problem is I don't...
70
by: lgbjr | last post by:
Hello All, I've been developing a VB.NET app that requires the use of a DB. Up to now, I've been using Access. It's a bit slow, but everything works. I'm at a point now where I need to decide if...
6
by: pinetaj | last post by:
Hello, I have a question of using 'property' on accessing elements of array. There is an array member in a class. I'd like to restrict accessing the elements of the array through property. And...
3
by: Georg Sauthoff | last post by:
Hi, t = (1, (2, 3)) I am bit suprised, that I cannot access '3' via: t. # syntax error But t.__getitem__(1) works like expected. Why is that?
0
by: thecoolone | last post by:
I am creating a REST API in php that parses the XML result given by IBM Omnifind. here's the php code: $query=$_GET;...
3
by: SM | last post by:
Hello, Im trying to access elements in my XML file using the JavaScript DOM but i'm not sure how. I use AJAX to access the XML and then use the responseXML property to access the XML file data. I...
1
by: zlf | last post by:
Hello my website has role based access, and user without specific role assigned cannot access specific page in website. When the user try to access a page who has not been granted to access, the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.