I have the below functions in regular JavaScript creating select options. Is there a way I can do this with jQuery without having to use the form object? Perhaps storing the
Something like:
function populate(selector) { $(selector) .append('foo') .append('bar') } populate('#myform .myselect');
Or even:
$.fn.populate = function() { $(this) .append('foo') .append('bar') } $('#myform .myselect').populate();