this worked great! thank you muchly!
On Aug 10, 11:19 am, Eduardo Pinzon wrote:
> try this:
> $("#custom1 option").each(function(){
> var class = $(this).html();
> addClass(class);
>
> });
>
> Eduardo Pinzon
> Web Developer
>
> 2009/8/10 Benn
>
>
>
> > This might have been resolved,
try this:
$("#custom1 option").each(function(){
var class = $(this).html();
addClass(class);
});
Eduardo Pinzon
Web Developer
2009/8/10 Benn
>
> This might have been resolved, but I can't find a solution with my
> search. I'm trying to add a class with the text of the option. Simple
You can achieve this with a loop using the each method:
$('select#custom1 option').each(function(){
var theText = $(this).html();
$(this).addClass(theText);
});
However, with your current HTML, the class names will have spaces in
them, which isn't valid.
3 matches
Mail list logo