var selValues = {};
selValues['234'] = $('#asd').val();
selValues['343'] = function () { var el = ''; $('#asd input[@type=checkbox]:checked').each(function() { el += $(this).val() + '|'; }); return el; } };
here’s the explanation:
im creating a key-value array where it extracts different values from DOM objects. The last array that you see in the example actually tries to extract checked items in a checkbox list. I tried to delegate the loop and return a delimited string of all checked values, but it’s not working.
A
mappingis probably a better solution here: