<option value="1" class="a"></option>
<option value="1" class="b"></option>
<option value="1" class="c"></option>
<option value="1" class="d"></option>
<option value="1" class="e"></option>
<option value="1" class="f"></option>
<option value="1" class="a"></option>
<option value="1" class="g"></option>
</body>
<script language="javascript">
var allClassName = $('option').map(function(){
  return this.className;
}).get();

var uniqueClassName = $.unique(allClassName); // returns an array of
unique class name
</script>

On Jun 11, 7:01 am, David <possum....@gmail.com> wrote:
> I'm interested in getting an array of unique class names of all option
> tags under a specific select element.
>
> I'm imagining something like this (which does not do what I want): $
> ( '#select_id option.class' );
>
> What's the correct way to do this using jQuery?
>
> Thanks!

Reply via email to