Alter the input type of form widgets.
Some native input types have undesirable native behavior. jQuery.mobile.degradeInputsWithin will alter the input type of such elements during page creation to fallback input types whose native behavior is acceptable. You can then achieve the user experience you desire by instantiating jQuery Mobile widgets on the modified native elements.
target
The element whose children should be considered for input degradation.
Examples:
Degrading Inputs
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jQuery.mobile.degradeInputsWithin demo</title> <link rel="stylesheet" href="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"> <script src="//code.jquery.com/jquery-1.10.2.min.js"></script> <script src="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> </head> <body> <div data-role="header"> <h2>jQuery Mobile Example</h2> </div> <div class="ui-content" role="main"> <form> <fieldset> <div class="ui-field-contain"> <label for="degraded-range">Type <code>range</code> degraded to <code>number</code></label> <input type="range" id="degraded-range" min="0" max="91" value="17"></input> </div> <div class="ui-field-contain"> <label for="degraded-search">Type <code>search</code> degraded to <code>text</code></label> <input type="search" id="degraded-search"></input> </div> <div class="ui-field-contain"> <label for="unchanged-url">Unchanged type <code>url</code></label> <input type="url" id="unchanged-url"></input> </div> </fieldset> </form> </div> </body> </html>
Please login to continue.