Is it possible to show all options from an HTML Select form field at once without clicking it?

后端 未结 2 1526
说谎
说谎 2021-02-07 15:04

I am using the X-Editable jQuery edit in place library for a Task Status selection field. All it;s stages are shown below from the process of:

  1. Clicking the Status
相关标签:
2条回答
  • 2021-02-07 15:33

    $("#Id_Selecteventtype")[0].selectedIndex = 1;

    0 讨论(0)
  • 2021-02-07 15:39

    http://jsfiddle.net/n1k5cLx0/

    Are you looking for a list or do you still want a dropdown with the options shown as default. For a list style you could use the size attribute with the select element.

    HTML

    <select size="3">
      <option>Not Started</option>
      <option selected>In Progess</option>
      <option>Completed</option>
    </select>
    

    CSS

    select{
        overflow:auto;
    }
    
    0 讨论(0)
提交回复
热议问题