Monday 30 September 2019

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



I thought that adding a "value" attribute set on the











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



Answer



Set selected="selected" for the option you want to be the default.





No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...