Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • add() method in Javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 107
    Comment on it

    add() Method
    The add() method is used to add an option in a drop-down list.
    This simplifies the work of user whenever it is required to add element or option.

    below is the example of add() method which is used in dropdown menu and gives the idea how to use it while working in javascript.

    <!DOCTYPE html>
      <select id="mySelect">
    window.onload=function myFunction() { /* window.onload Execute a JavaScript immediately after a page is loaded*/
      for(var i=1;i<31;i++){
        var x = document.getElementById("mySelect");
        var option = document.createElement("option");
        option.text = i;

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: