前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >select选择标签自定义下拉按钮

select选择标签自定义下拉按钮

作者头像
马克社区
发布2022-07-18 15:19:30
1.5K0
发布2022-07-18 15:19:30
举报
文章被收录于专栏:高端IT高端IT高端IT
<select>
<option value="" disabled selected style="display:none;">请选择时间</option>
</select>



select::-ms-expand { display: none; }      //兼容ie隐藏
select{
     appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    background: url(../images/go.png) no-repeat scroll 386px center transparent;
}

15个实用实用正则(小哥进来看看?)

// 1 用户名正则 //用户名正则,4到16位(字母,数字,下划线,减号) var uPattern = /1{4,16}KaTeX parse error: Undefined control sequence: \d at position 146: …*(?=.{6,})(?=.*\̲d̲)(?=.*[A-Z])(?=…%^&? ]).KaTeX parse error: Expected 'EOF', got '#' at position 46: …est("caibaojian#̲"));//输出 true /…/; //负整数正则 var negPattern = /^-\d+KaTeX parse error: Undefined control sequence: \d at position 32: …tPattern = /^-?\̲d̲+/; console.log(posPattern.test(“42”));//输出 true console.log(negPattern.test("-42"));//输出 true console.log(intPattern.test("-42"));//输出 true // 4 数字正则 //正数正则 var posPattern = /^\d*.?\d+KaTeX parse error: Undefined control sequence: \d at position 31: …egPattern = /^-\̲d̲*\.?\d+/; //数字正则 var numPattern = /^-?\d*.?\d+KaTeX parse error: Undefined control sequence: \- at position 172: … /^([A-Za-z0-9_\̲-̲\.])+\@([A-Za-z…/; console.log(ePattern.test(“815682884@qq.com”));//输出 true // 6 手机号码正则 //手机号正则 var mPattern = /^1[34578]\d{9}KaTeX parse error: Undefined control sequence: \d at position 98: …ar cP = /^[1-9]\̲d̲{5}(18|19|([23]…/; console.log(cP.test(“11010519880605371X”));//输出 true // 8 URL正则 //URL正则 var urlP= /^((https?|ftp|file)😕/)?([\da-z.-]+).([a-z.]{2,6})([/\w .-])/?KaTeX parse error: Can't use function '\.' in math mode at position 138: …1]?[0-9][0-9]?)\̲.̲){3}(?:25[0-5]|…/; //输出 true console.log(ipP.test(“115.28.47.26”)); // 十六进制颜色正则 //RGB Hex颜色正则 var cPattern = /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})KaTeX parse error: Expected 'EOF', got '#' at position 31: …cPattern.test("#̲f8f8f8"));//输出 …/; console.log(dP1.test(“2017-05-11”));//输出 true console.log(dP1.test(“2017-15-11”));//输出 true //日期正则,复杂判定 var dP2 = /^(?😦?!0000)[0-9]{4}-(?😦?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)/ ; c o n s o l e . l o g ( d P 2. t e s t ( " 2017 − 02 − 11 " ) ) ; / / 输 出 t r u e c o n s o l e . l o g ( d P 2. t e s t ( " 2017 − 15 − 11 " ) ) ; / / 输 出 f a l s e c o n s o l e . l o g ( d P 2. t e s t ( " 2017 − 02 − 29 " ) ) ; / / 输 出 f a l s e / / 12 Q Q 号 码 正 则 / / Q Q 号 正 则 , 5 至 11 位 v a r q q P a t t e r n = / [ 1 − 9 ] [ 0 − 9 ] 4 , 10 /; console.log(dP2.test("2017-02-11"));//输出 true console.log(dP2.test("2017-15-11"));//输出 false console.log(dP2.test("2017-02-29"));//输出 false // 12 QQ号码正则 //QQ号正则,5至11位 var qqPattern = /^[1-9][0-9]{4,10}/;console.log(dP2.test("2017−02−11"));//输出trueconsole.log(dP2.test("2017−15−11"));//输出falseconsole.log(dP2.test("2017−02−29"));//输出false//12QQ号码正则//QQ号正则,5至11位varqqPattern=/[1−9][0−9]4,10/; console.log(qqPattern.test(“815682884”));//输出 true // 13 微信号正则 //微信号正则,6至20位,以字母开头,字母,数字,减号,下划线 var wxPattern = /2([-_a-zA-Z0-9]{5,19})+/ ; c o n s o l e . l o g ( w x P a t t e r n . t e s t ( " m a o m i n 9761 " ) ) ; / / 输 出 t r u e / / 14 车 牌 号 正 则 / / 车 牌 号 正 则 v a r c P a t t e r n = / [ 京 津 沪 渝 冀 豫 云 辽 黑 湘 皖 鲁 新 苏 浙 赣 鄂 桂 甘 晋 蒙 陕 吉 闽 贵 粤 青 藏 川 宁 琼 使 领 A − Z ] 1 [ A − Z ] 1 [ A − Z 0 − 9 ] 4 [ A − Z 0 − 9 挂 学 警 港 澳 ] 1 /; console.log(wxPattern.test("maomin9761"));//输出 true // 14 车牌号正则 //车牌号正则 var cPattern = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}/;console.log(wxPattern.test("maomin9761"));//输出true//14车牌号正则//车牌号正则varcPattern=/[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领AZ]1[AZ]1[AZ0−9]4[AZ0−9挂学警港澳]1/; console.log(cPattern.test(“鲁B66666”));//输出 true

更多内容请见原文,原文转载自:https://blog.csdn.net/weixin_44519496/article/details/120074211

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 15个实用实用正则(小哥进来看看?)
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档