I need to access database and update options of a select tag. My code is here.
$(window).load(function () { $.getJSON(\'http://localhost/ABC/web/app_d
Use the following code to append your tag:
$("#idcatFill").append(function() { var elem = $(''); for (var i = 0; i < length; i++) { row = data[i]; elem.append('' + row['category_name'] + ''); } return elem; });
you can't attach incomplete elements to the dom. You need to build your tag before inserting it.