easy peasy:

set the value:

$(element).attr('kids',new_value);

and to retrieve the value:

$(element).attr('kids');

On 12/30/06, Oliver Boermans <[EMAIL PROTECTED]> wrote:

Hi all

What is the best way to attach and access my own properties to DOM
elements within the confines of jQuery?

I'm attempting to write a script which iterates through a multi-level
multi-nested ordered list. Starting from the deepest level and working
up, I want to store an accumulated value on each element - based on
the number of children each ol / li contains.

Storing the values within a .each() is working okay:
    this.kids = count;

But retrieving these values is proving to be a problem - for me at
least... My JavaScript knowledge gets patchy outside basic DOM
manipulation.

If this doesn't make sense please quiz me!

Is there a better way to handle this kind of thing?

Cheers
Ollie

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to