摘要: 写了个对应的正则代码,发现自己不会处理正则表达式中的变量,通过度娘查找一番才发现解决办法。 function replaceStr(oldStr, childStr){ var re = new RegExp(childStr, "g");//通过RegExp使用变量 oldStr = oldStr.replace(re, '替换'); console.log... 阅读全文
posted @ 2017-04-20 12:53 宋宇 阅读(5846) 评论(0) 推荐(0) 编辑
摘要: function move() { var s1=document.getElementById("s1"); var s2=document.getElementById("s2"); var add; if(s1.value=="SC") { ad... 阅读全文
posted @ 2017-04-20 12:52 宋宇 阅读(1015) 评论(0) 推荐(0) 编辑
摘要: $('#someId').prop('selectedIndex'); $('option:selected', '#someId').index(); $('#someId option').index($('#someId option:selected')) 以上三种方式可以取到索引值 阅读全文
posted @ 2017-04-20 12:46 宋宇 阅读(4939) 评论(0) 推荐(0) 编辑
摘要: 判断是否移动端 阅读全文
posted @ 2017-04-20 12:44 宋宇 阅读(254) 评论(0) 推荐(0) 编辑