I am trying to appended an HTML select menu via jquery, but nothing shows up. This code ran fine when I only appended the textbox. When I added the <select> menu, it stopped working:
$(document).ready(function(){
$("#add").click(function(){
$("#pTags").append("
<select>
<option>Volvo</option>
</select>
<input type='text' placeholder='Class #'><br>
");
});
});
This works:
This fails:
Sometimes this is desirable for readability.
Add backslashes to get it to work:
Or plus sign
or furthermore you can see other ways and try the one that you liked most HERE
For you, checkout this snippet or JSFiddle Example :