Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 15881

How can I set the default value for an HTML element?

$
0
0

I thought that adding a "value" attribute set on the <select> element below would cause the <option> containing my provided "value" to be selected by default:

<select name="hall" id="hall" value="3"><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option></select>

However, this did not work as I had expected. How can I set which <option> element is selected by default?


Viewing all articles
Browse latest Browse all 15881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>