I am trying to add the selected value of combo box to its preceding span. but it failed too sad.
I am trying with following code:
<span></span><select multiple ="multiple" ondblclick="$(this).css('display','none').prev().css('display','inline').addClass('sss').html($(this).val());">....</select>
What’s the error here? how can i do it easily?
I want it to trigger in double click event. as after double clicking on option of combo box it should disappear and selected text should appear in span
and of course i forgot to tell that my select box is not selectbox. its a lisstbox. i.e multiple=”multiple”
You need to put an
optionin yourselecttag.js
Example: http://jsfiddle.net/jasongennaro/AKa9b/
EDIT
Based on the comment not working in context of multiple option, I revised as follows:
Second example: http://jsfiddle.net/jasongennaro/AKa9b/2/