Recently has been using bootstrap to do the page, personal feeling simple atmosphere is very easy to use, today with plug-in chosen found can not check the value, debugging a long time, view source file JS and other methods, finally resolved: Offer code:
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m00/72/ff/wkiom1xxv4ka8e9jaadeqxklgai497.jpg "title=" qq picture 20150910181152.png "alt=" Wkiom1xxv4ka8e9jaadeqxklgai497.jpg "/>
Whether the style or auto-match feature is better:
Cannot clear the selected
Workaround:
$ ("#id"). Val ("");
$ ("#id"). Trigger ("chosen:updated");
Set the selected value
$ ("#id"). Val ("Selected value");
$ ("#id"). Trigger ("chosen:updated");
Set the selected text
$ ("#id"). Text ("Selected value");
$ ("#id"). Trigger ("chosen:updated");
All in all, it triggers the update of this selection event each time it is set.
* Listener Selection Change event:
$(
"#id"
).chosen().change(
function
(){
//do something...
*设置多选
$ ("#id"). attr ("multiple", true);
* Set the display text when not found
$ ("#id"). Chosen ({
no_results_text: "This option is not found!",
width: "70%"
});
This article from the "JAVA" blog, reproduced please contact the author!
About Chosen-select Setting the check value and emptying the selected value