I need to style a series of Select options for a form, and I'm looking for jQuery plugins that allow me to do this. However, I also need to be able to reset the Select box (or even just choose the first Option) when I click on an input type="reset". Does anyone have any experience with this?
Asked
Active
Viewed 76 times
0
-
You dont need jquery to style select box. You can check bootstrap – brk Jun 11 '19 at 06:33
1 Answers
0
For the select reset just see this answer: How to reset a select element with jQuery
For the style what do you mean?
1) Static Style;
2) Dynamic Style;
For the static styling learn something about css properties and style them with your proper class attribute.
.my-class-color {
color: red;
border: 2px solid black;
}
For the dynamic styling you need a mixing of css classes and jquery events.
// Add class when user change value of select
$(document).on('change', 'select.select-form', function() {
$(this).addClass('my-class-color');
});
Dario
- 722
- 6
- 27