![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
qq_35577329
我有故事,你有酒吗?
展开
-
js复制
<textarea cols="20" rows="10" id="biao1">用户定义的代码区域</textarea> <input type="button" onClick="copyUrl2()" value="点击复制代码" /> </body>原创 2020-05-20 18:58:40 · 107 阅读 · 0 评论 -
javascript 移动端获取用户当前位置经纬度信息
一、HTML5 geolocation的属性if(navigator.geolocation){navigator.geolocation.getCurrentPosition(onSuccess , onError);}else{alert(“您的浏览器不支持使用HTML 5来获取地理位置服务”);}//定位数据获取成功响应function onSuccess(position)...原创 2020-03-20 17:13:49 · 329 阅读 · 0 评论 -
js 选择checkbox
var data = [];$(checkStatus.data).each(function(){//alert(this.id+"****");data.push(this.id);goodsVal[0].innerHTML = parseFloat(this.number * this.price.slice(1)) + Number(goodsVal[0].innerHTML);...原创 2020-03-14 02:06:59 · 116 阅读 · 0 评论 -
js时间延迟
setTimeout(function() {bvv(d.id,d.deviceId)}, 2000)原创 2019-11-17 09:12:43 · 148 阅读 · 0 评论 -
js获取select标签选中的值- roak.com
var obj = document.getElementByIdx_x(”testSelect”); //定位idvar index = obj.selectedIndex; // 选中索引var text = obj.options[index].text; // 选中文本var value = obj.options[index].value; // 选中值jQuery中获得选中se...原创 2019-10-14 18:39:40 · 148 阅读 · 0 评论 -
js 数字转金额
function formatMoney(s, type) {if (/[^0-9.]/.test(s))return “0”;if (s == null || s == “”)return “0”;s = s.toString().replace(/^(\d*)$/, “$1.”);s = (s + “00”).replace(/(\d*.\d\d)\d*/, “$1”);s = ...原创 2019-06-10 09:42:01 · 360 阅读 · 0 评论 -
js输入金额
<input 4οnchange=“this.value=cc(this.value)”>function cc(s){if(/[^0-9.]/.test(s)) return “invalid value”;s=s.replace(/^(\d*)$/,"$1.");s=(s+“00”).replace(/(\d*.\d\d)\d*/,"$1");s=s.replace(...原创 2019-09-28 10:00:33 · 488 阅读 · 0 评论 -
JS 循环遍历JSON数据
var data=[{name:“a”,age:12},{name:“b”,age:11},{name:“c”,age:13},{name:“d”,age:14}];for(var o in data){alert(o);alert(data[o]);alert(“text:”+data[o].name+" value:"+data[o].age );}...原创 2019-10-04 17:07:27 · 638 阅读 · 0 评论