javascript下正则匹配百分比的代码
<script language="javascript"> var re = /^-?\d+%$/; alert(re.test('50%')); alert(re.test('-25%')); alert(re.test('3a5%')); </script>
<script language="javascript">
var re = /^-?\d+%$/;
alert(re.test('50%'));
alert(re.test('-25%'));
alert(re.test('3a5%'));
</script>
var re = /^-?\d+%$/;
alert(re.test('50%'));
alert(re.test('-25%'));
alert(re.test('3a5%'));
</script>
很赞哦!()
大图广告(830*140)