Hello all, first post here :)

For applying styles to several divs you should use class instead of  
ID. This is a best practice and a standard widely used. ID's for  
uniqueness and classes for batch update :)

Peace,

Zen


On Apr 14, 2008, at 3:42 PM, Brian Williams wrote:

> Hey Chich,
>
> You might want to brush up on your x/html rules, an ID value should  
> be unique to that page i.e. you should only have one div id=T8 on  
> the page - that or redesign the DOM structure of your page because I  
> believe Prototype is designed with the unique ID rule in mind (This  
> I assume because I've never tried to use the same ID on a page)
>
> As for changing the style of the div look up SetStyle and  
> AddClassName in the Prototype API docs.
>
> HTH
>
>
>
> On Mon, Apr 14, 2008 at 10:34 AM, chich <[EMAIL PROTECTED]> wrote:
>
> How can I  control a div from a javascript function.
> For example if i have a product and has an id=8 and this product has 3
> trainees
> so when i click on something  i should see the 3 trainees name for
> this product.
> in the code i created a div with id="T<?=product_id?>" (id=T8)  class
> ="LINKSOFF" (hidden)
> how can i turn the class to class="LINKSON" from a javascript
> function.
> The problem is that when i have many div with the same id and write
> class="LINKSON" i can not see the div.
>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-spinoffs@googlegroups.com
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