jQuery.mobile.degradeInputsWithin( target )Returns: Undefinedversion added: 1.4.0
Description: Alter the input type of form widgets.
-
jQuery.mobile.degradeInputsWithin( target )
- targetType: ElementThe element whose children should be considered for input degradation.
-
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.
Example:
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>