How can I use JavaScript to change the selected item in a drop-down menu?
<select name="example_length" aria-controls="example" class="">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
I attempted to change the value of the drop-down menu with this code:
document.getElementsByName("example_length")[0].value = 100;
However, only the number changed in the HTML code and not the actual content;
Here is an example link showcasing table sorting.