Why the jQuery Selectable plugin doesn't work with a foreach generated list?
问题 I am currently working on an MVC project and implemented jQuery Selectable plugin. I have a string in my model which I have Split() as below in my view: @{ var size = Model.AvailableSizes.Split(','); foreach (var item in size) { <ol class="ui-selectable" id="selectable"> <li class="ui-selectable">@item</li> </ol> } } Here is the static script defined in my view: <script type="text/javascript"> $(document).ready(function () { $("#selectable").selectable(); }); </script> The selectable jQuery