Orangejuice
Orangejuice

Reputation: 21

Customizing a select with Jquery

I have been searching a lot and I cant find anything.

I would like to customize a select checkbox with jquery. Do you know how could I do it? Any page with a tutorial or if you could help me please?

I would like to customize the dropdown button and also the inside of the <option>. With CSS I cant do it and I was told that with jquery it is possible but I cant find it...

Thanks in advance!!

This is what I would like to customize with jquery:

<select class="select-dropbox" name="select-dropbox">
    <option>option1</option>
    <option>option2</option>
    <option>option3</option>
    <option>option4</option>
    <option>option5</option>
</select>

Upvotes: 0

Views: 560

Answers (1)

producerism
producerism

Reputation: 344

Have you looked into the jQuery UI library? It makes customizing form elements much easier. Here is the example page for a "splitbutton" which is basically a select:

http://jqueryui.com/demos/button/#splitbutton

jQuery UI replaces the element with a div, which gives you lots of options in customization. You would simply listen for a click on the drop-down button, and then code a list to show up, etc.

Here's a good example:

http://www.jeasyui.com/tutorial/mb/splitbutton.php

Upvotes: 1

Related Questions