問題:
I have a very weird requirement, wherein I am required to have no option selected by default in drop down menu in HTML.我有一個非常奇怪的要求,其中我需要在 HTML 的下拉菜單中默認沒有選擇任何選項。 However,然而,
I cannot use this,我不能用這個,
<select> <option></option> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select>
Because, for this I will have to do validation to handle the first option.因爲,爲此我將不得不進行驗證來處理第一個選項。 Can anyone help me in achieving this target without actually including the first option as part of the select tag?任何人都可以幫助我實現這個目標而不實際將第一個選項作爲選擇標籤的一部分嗎?
解決方案:
參考一: https://en.stackoom.com/question/a6ge參考二: https://stackoom.com/question/a6ge