Hello. there is

<select name="s"> <option></option> </select> 

In this select multiple option values. And when select is not yet deployed, the first option is visible by default.

Question: How can I make my text there by default, and when I expand this select, my text is no longer in it?

    1 answer 1

    Let me Google it for you (Question asked a thousand times where possible) Under the link - the original thread on SO.com

     <select onclick = 'this.children[0].remove()'> <option value="" disabled selected>Select your option</option> <option value="hurr">Durr</option> </select> //Слегка модифицированный код под нужды спрашивающего. Суть поясняет, все красивости добавляются по вкусу 

    UPD: More "high-quality" implementation on bare css + html.

     option[default] { display: none; } 
     <select> <option value="" default disabled selected>Select your option...</option> <option value="hurr">Hurr</option> <option value="durr">Durr</option> </select> 

    • click a second time what will happen? - teran
    • Вопрос: Каким образом сделать чтобы по умолчанию там был мой текст, а когда развернуть этот селект, в нем моего текста уже не было? //Суть поясняет, все красивости добавляются по вкусу this answer the question? Yes, it does. I indicated that this conveys the essence, the further development of the code to the discretion of the author? Yes, he did. What are the questions? - SLy_huh
    • to the fact that the quality of response is lame. If you write the answer, then write quality, but not a semi-working option. In this case, it would be better to send a link to the original in the comments, that's all. - teran
    • @teran, I think my answer satisfies the question of the author. The code is 100% working, at least with respect to the task. I do not think that the author is not in a position to suppose that if the code is left in its original form, then it will work as something wrong. And maybe you need to change remove to some kind of .style.display = 'none' in the toggle version. The answer is listed as correct, I do not understand what the problem is. Eniveis, I see no reason to continue. - SLy_huh