using jQuery I have the following code:
var selectedIdsArray = $("#selectId option:selected").map(function(){return this.value;});
var selectedIdsStr = $.map(selectedIdsArray, function(val){ return "" + val + "";});
It successfully retrieves an identifier string, for example. selectedIdsStr = "2.45,245.1" from the item <select multiple='multiple'>. I was wondering if there is a more efficient way (less code) to achieve this?
Thanks!
source
share