The add() method is used to add an option to a dropdown list. Here in this example we have added an option to the select tag by using the add() method.
option : it is the option value which is to be added into the select tag's option list and this argument is required.
before : it specifies the position of the option value to be added and it is also required while adding some option to the select tag option.
Description of example:
When you will run this HTML page on the browser you will see that it contains only four elements into it.
Now when you will click on the "Add" button it will add one more option to the list named with the "kumar" at the "5" position.
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: January 29, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles