javascript - Set the default value of a dropdown which is populated dynamically using Java script -
i see lot of dropdowns defined @ multiple locations in jsp. this: (with different ids).
<select class="school-names" name="schoolname" id="aaschoolname" > </select>
these dropdowns populated below:
<c:foreach items="${schools}" var="sc"> var scname = "${sc.schoolname}"; jquery('.school-names').append('<option value="' + scname + '">' + scname + '</option>'); </c:foreach>
this dropdown populated on load of jsp page. how set default value of each dropdown onload of jsp page.
Comments
Post a Comment