1 $("#filterText").click(function () { 2 var v = $('#filtertype option:selected').val(); 3 if (v == 'Index') { 4 $("#filterText").attr('pattern','^[A-Za-z]+$'); 5 } 6 }); 7
//JQ设置H5中的正则表达式