jQuery Mobile 1.1.1 Custom Select Menu - Placehold

2019-02-22 02:42发布

问题:

After upgrading to jQuery Mobile 1.1.1 earlier today (7/13/2012) I noticed that all of my Custom Select menus no longer show the placeholder text on page load. Is there something I need to do differently in 1.1.1 to show the placeholder text in custom select menus? Help!?!?

Here's a sample of my code:

<div data-role="fieldcontain" class="ui-hide-label no-field-separator">
      <label for="ceiling" class="select" data-theme="a">Ceiling</label>
       <select name="ceiling" id="ceiling" data-theme="a" data-native-menu="false" class="required">
            <option data-placeholder="true">Ceiling (Yes/No)</option>
            <option value="Yes">Ceiling: Yes</option>
            <option value="No">Ceiling: No</option>
      </select>
</div>

Sample image (the black bars are my custom select menus):

回答1:

this code is working for me :

<select>
  <option value="" data-placeholder="true">Choose one:</option>
  <option value="1">One</option>
  <option value="2">Two</option>
</select>

Just put value="" on your placeholder option