Is it possible to set the width of a jQuery autocomplete combobox?

后端 未结 14 2303

I am using this jQuery UI combobox autocomplete control out of the box off the jQuery UI website:

My issue is that I have multiple comboboxes on a page, and I want t

14条回答
  •  情深已故
    2020-12-28 14:43

    Don't bother with JavaScript. You can easily do this in CSS as you were originally trying to do. All you need to do is add a unique selector to each one. For example:

    HTML would look like this

    CSS would look like this

    .ui-autocomplete-input
    { 
        width: 120px;
    }
    .title .ui-autocomplete-input
    { 
        width: 200px;
    }
    .tags .ui-autocomplete-input
    { 
        width: 600px;
    }
    

提交回复
热议问题