Essentially what the aim of the game here is to set the selected option in each of the multiple select listbox’s <option> entries. In order to do this, we will once again make use of jQuery’s nifty prop() function and apply this to the result of our clever little jQuery selector call, which will hone in on our desired select listbox using its ID value and then extending that result to only include all option entries.
So the resulting call would look something like this:
And there you go. A multiple select listbox with everything already selected for you!