A
A
Alexander2015-10-01 18:28:53
JavaScript
Alexander, 2015-10-01 18:28:53

Selectize.js - how to select the desired item from the list using jQuery?

Tell me , who used the selectize.js library , how to select the desired list item using jQuery?
Ordinary selects are selected according to the following principle:

$('#select option[value=3]').prop("selected", true);

And styled with selectize.js doesn't work that way. I didn’t understand much from the documentation, there is a setValue () method, but nothing happened to me. Tell me or poke your nose where you need :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zubarev, 2015-10-01
@Palehin

It's hard to say why setValue() doesn't work for you. Try like this:

var $select = $('#select').selectize();
$select[0].selectize.setValue("3");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question