I am dynamically creating HTML items using jQuery. Though items are dynamically created but their attributes are note. I mean if I assign class and id in the $() call, the elements are created without those attributes. Even my browser is showing null attributes. Problem is recognized when I tried to populate drop down according to first drop down selection.
for (var i = 1; i <= prescriptionnum; ++i) {
$("<select/>", {
class: 'selectdoctor',
name: 'selectdoctor' + i,
id: 'selectdoctor' + i
}).appendTo("#prescriptiondiv").after("<br/>");
$("<input/>", {
type: "text",
class: "textinput",
name: "textinput" + i,
id: "textinput" + i
}).appendTo("#prescriptiondiv").after("<br/><input type='file' id='imageinput'"+ i +" class='imageinput' /><br/><br/>");
}
If same drop-down is created with class selectdoctor using HTML its working and the browser also show attributes but not for the ones that jQuery creates.
<select/>the same as<select>.