1

I have a multi_select dropdown with values say 1,2,3,4.

$('#changes-selectyes').trigger('change').val('1');

I want to select multiple value at once. But using current method i am able to set only one value. How can i select multiple ?

0

3 Answers 3

1

Demo

You can use array notation as value like in the following code.

$('#changes-selectyes').trigger('change').val(['2', '3']);
Sign up to request clarification or add additional context in comments.

Comments

0

Pass Array into thee val function:

Try this code

$('selector).trigger('change').val(['1','2','3','4']);

Comments

0

I figured out i need to pass array inside the val() in order to pass multiple values.

$('#changes-selectyes').trigger('change').val(['1','2','3','4']);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.