I am using a couple of MagicSuggest controls on my page, with the following code:
<div id="my_id1" class="magicsuggest"></div>
<div id="my_id2" class="magicsuggest"></div>
...
var ms = $('.magicsuggest').magicSuggest({});
$(ms).on('selectionchange', function(event, combo, selection){
var id = combo.input[0].offsetParent.id;
...
});
I have found this quite cumbersome way to retrieve back the id
of my <div>
, but am wondering if there is more elegant way to do this?