Liviu
Liviu

Reputation: 1093

Jquery Chosen automatic select

I am using the Harvest Chosen jQuery plugin like so:

 $(".chzn_b").chosen();

It allows me to select multiple options from my select but sometimes when i land on the page i want to have some stuff preselected.
How do i do that ?

Upvotes: 0

Views: 1634

Answers (1)

arieljuod
arieljuod

Reputation: 15838

You have to define the selected attribute on the option tag inside that select http://www.w3schools.com/tags/att_option_selected.asp

Then Chosen should set that as the selected value.

Upvotes: 1

Related Questions