xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

input select & input unselect

input select & input unselect

input select

https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select
https://stackoverflow.com/questions/10413704/how-to-select-value-of-input-onclick

input unselect

https://bytes.com/topic/javascript/answers/429209-how-unselect-text-input-box


if (document.selection)
    document.selection.empty();
else if (window.getSelection)
    window.getSelection().removeAllRanges();
}


html select

https://www.w3docs.com/learn-html/html-select-tag.html


<select>
        <option value="books">Books</option>
        <option value="html">HTML</option>
        <option value="css">CSS</option>
        <option value="php">PHP</option>
        <option value="js">JavaScript</option>
</select>

    <select aria-label="Books nad Snippets">
      <optgroup label="Books">
        <option value="html">HTML</option>
        <option value="css">CSS</option>
      </optgroup>
      <optgroup label="Snippets">
        <option value="git">Git</option>
        <option value="java">Java</option>
      </optgroup>
    </select>

<input type = "text" list = "airports" name="airports"> 

<datalist id = "airports">
        <option value = "Berlin">
        <option value = "Los Angeles">
        <option value = "Moscow">
        <option value = "Paris">
</datalist>

https://www.w3schools.com/tags/tag_select.asp

<label for="cars">Choose a car:</label>

<select id="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>

multi select bug


<label for="cars">Choose  cars:</label>

<select id="cars" multiple>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="opel">Opel</option>
  <option value="audi">Audi</option>
</select>

https://element.eleme.io/#/zh-CN/component/select#ji-chu-duo-xuan

refs



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2019-01-21 13:56  xgqfrms  阅读(671)  评论(5编辑  收藏  举报