How to add Option to a Select Box (Drop Down) using jQuery – Tutorial

In this tutorial we are going to see how to add a new <option> tag to an existing <select> drop down using jQuery.
Also we are going to learn how to add <option> to the top of the <select> drop down as well as bottom of the <select> drop down.

Here is a snippet: (To add an option tag to the top of the select)

Here is a snippet: (To add an option tag to the bottom of the select)

So, basically append() will add the tag to the bottom of the list and prepend() will add the tag to the top of the list.

Here is an another working example for you to play around with it:

To ease, here is the demo:

Demo

Add a Comment

Your email address will not be published. Required fields are marked *