I using YUI 3, but I have a question about YUI usage.
I have a select tag with some option tags:
YUI().use( "node", "event", "cssbutton", function(Y){
Y.one('body').addClass('yui3-skin-sam');
Y.one('#btnSel2').on('click',function(){
Y.one('#mySelect').set('value', '5');
});
});
<select id="mySelect" size="10" multiple="true">
<option value="1">Apple</option>
<option value="2">Mango</option>
<option value="3">PineApple</option>
<option value="4">Orange</option>
<option value="5">Peach</option>
</select>
<button id="btnSel2" class="yui3-button">Set Selected</button>
The above method just cover one value, can i set multiple value from array or string with comma delimited?
If you check
yui3/build/dom-base/dom-base.jsline 202 you will see this feature is not implemented:Here is how we implemented this feature: