On Jan 23, 2008 3:42 PM, elduderino <[EMAIL PROTECTED]> wrote:
> ....how do i add an id to an element i've just created....i've just
> done:

You'll want to use the Element constructor for that:
http://prototypejs.org/api/element

new Element('a', { id: 'my-id', class: 'my-class', href:
'http://www.prototypejs.org/api/element' }).update('Click me to see
the API for the Element object');

Much handier than the old way of doing things with document.createElement().

-justin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to