There can be more else if blocks. Note: Returns null if the index number is out of range. This Javascript post was going to be about language selection in FCKEditor from a drop down box as a follow up to the previous FCKEditor post but I've decided to postphone that post until Friday and look at how to add options to an HTML element that are currently selected. JavaScript Switch Statement Absolute Beginner Lesson 14. The final else is optional. Conditional operator ‘?’ Sometimes, we need to assign a … If these conditions were met we display, “Its the weekend in the month of June”. Human beings (and other animals) make decisions all the time that affect their lives, from small ("should I eat one cookie or two?") The first just informs the user to select an option, and the next two are actual choices. Tabs Dropdowns Accordions Side Navigation Top Navigation Modal Boxes Progress Bars You can use conditional statements in your code to do this. I have a table with many rows. Changing a select option without JQuery. I hope you enjoyed the article. An option is considered selected if it has an HTMLOptionElement.selected attribute. Syntax. The Select object represents an HTML element by using getElementById(): Example. It’s also not a terrific idea to include an entire library just for the sake of changing a select element. If you are reading this in a feed reader the Javascript may not work. [ index] Returns the