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
If you need to make single element you can use this construction:
$('', {
'class': this.dataID,
'text': this.s_dataValue
}).appendTo('.subCategory');
But if you need to print many elements you can use this construction:
function printOptions(arr){
jQuery.each(arr, function(){
$('', {
'value': this.dataID,
'text': this.s_dataValue
}).appendTo('.subCategory');
});
}