diff --git a/js/jquery.mobile.page.js b/js/jquery.mobile.page.js index 6289157a..b3918a1e 100644 --- a/js/jquery.mobile.page.js +++ b/js/jquery.mobile.page.js @@ -139,8 +139,10 @@ $.widget( "mobile.page", $.mobile.widget, { $elem.fixHeaderFooter(); }, + _typeAttributeRegex: /\s+type=["']?\w+['"]?/, + _enhanceControls: function() { - var o = this.options; + var o = this.options, self = this; // degrade inputs to avoid poorly implemented native functionality this.element.find( "input" ).not(this.keepNative).each(function() { @@ -150,7 +152,7 @@ $.widget( "mobile.page", $.mobile.widget, { if ( o.degradeInputs[ type ] ) { $( this ).replaceWith( $( "
" ).html( $(this).clone() ).html() - .replace( / type="?([a-zA-Z]+)"?/, " type=\""+ optType +"\" data-type=\""+type+"\" " ) ); + .replace( self._typeAttributeRegex, " type=\""+ optType +"\" data-type=\""+type+"\" " ) ); } });