This is a boolean attribute. A Boolean, returns true if the option is selected, otherwise it returns false, false - Default. If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: document.getElementById("orange").selected = true; var x = document.getElementById("banana").selected; W3Schools is optimized for learning and training. What will happen if a legally dead but actually living person commits a crime after they are declared legally dead? Creating new options in the dropdown. You are appending to the table (table.append...) if you want to add it to the same cell or row, you should be appending to that and not the table. Is it safe to use RAM with a damaged capacitor? Do not rely on the selected attribute of