How to disable the Dropdown?

Problem

I am using JqueryMobile-1.3.0 and cordova-2.1.0 for iOS app.I want to disable the dropdown dynamically how to do that?I am doing like this $('#assignedToDropDown').attr('disabled', true); Using this it will become disable but it will look like active element means disable element css is not getting applied on this.

Problem courtesy of: snehad

Solution

$('select').selectmenu('disable');

Read more about it here: http://jquerymobile.com/demos/1.2.0/docs/forms/selects/methods.html

Working example: http://jsfiddle.net/Gajotres/dEXac/

Solution courtesy of: Gajotres

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.