I am creating dynamic drop down in my template. I can’t get the selected value of those.
var newjobDropDown = $(document.createElement('div')).attr("id", 'jobDropDown' + counter);
newjobDropDown.after().html('<label><?php echo __(Job Vacancy); ?></label>' +
'<select id="jobDropDown' + counter +'"'+' onchange="validate()"'+' class="vacancyDrop"'+'>'+buildVacancyList()+'</select>'+
'<span onclick="removeDrop(event)"'+'class="removeText"'+ 'id="removeButton'+counter+'">'+remove+'</span>'+'<br class="clear" />');
newjobDropDown.appendTo("#TextBoxesGroup");
I used the following code to get the value, but i got a null value.
$('#jobDropDown1').val()
You call
but you select looks like
Add
1to its id and it will do the trick