0

I want to get the list of email id's that i have input in my select2 input box. here is my view
UI of my select2

I want to get the list of emails that i have entered in input box and then i want to send that in ajax call.

here is my HTML

<div class="col-9">
  <div class="input-holder">
        <select class="mail-input select-2-input" multiple="multiple">
        </select>
    </div>
</div>

Here is my js

 $(".select-2-input").select2({
    tags : true,
    placeholder : "Enter Business Email",
    tokenSeparators : [ ',', ' ' ]
})

1 Answer 1

1

Get data from select2

console.log($(".select-2-input").select2('data'));

Get value

console.log($(".select-2-input").select2("val"));
Sign up to request clarification or add additional context in comments.

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.