Hey, Setting styles can be done using the the setStyle method: http://api.prototypejs.org/dom/element/setstyle/
Selecting elements using a css selector can be done using the $$ method which is short for Element.select() but then global: http://api.prototypejs.org/language/dollardollar/ http://api.prototypejs.org/dom/element/select/ Since $$ and Element.select both give an array of elements (even it's just 1) you can invoke the setStyle method on each element: http://api.prototypejs.org/language/enumerable/prototype/invoke/ so in your case this should work: $$("td:contains('Pendiente')").invoke('setStyle', { background: '#c00' }); Take a look at the links I mentioned above for possible optimalisations on that code. Greetings, Johan On Tue, Aug 31, 2010 at 3:39 PM, VEO creativos <[email protected]>wrote: > Hi! I'm trying to assign a CSS style to a TR that contains the words > "Pendiente", "Procesando" and "Completo". > I've made this for jQuery, but I need to do it with prototype/ > scriptaculous and I'm a totally newbie. > > Thanks in advance for any help! > > This is the code I've made for jQuery: > <script> > $("td:contains('Pendiente')").css("background", "#c00"); > $("td:contains('Procesando')").css("background", "#0c0"); > $("td:contains('Completo')").css("background", "#000"); > </script> > > Thanks!! > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<prototype-scriptaculous%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en.
