一.select下拉框 I:javascript方法 1:获取选中的值 F1:   var  myselect=document.getElementById("test");或者var myselect = document.all["test"];   var index=myselect.selectedIndex ;    // selectedIndex代表的是你所选中项的index   myselect.options[index].value;   m…
JS中Float类型加减乘除 修复   MXS&Vincene  ─╄OvЁ  &0000027─╄OvЁ  MXS&Vincene MXS&Vincene  ─╄OvЁ:今天很残酷,明天更残酷,后天很美好,但是绝大部分人是死在明天晚上,只有那些真正的英雄才能见到后天的太阳. MXS&Vincene  ─╄OvЁ:We're here to put a dent in the universe. Otherwise why else even be here? 正文…
js jquery去除数组中的重复元素 第一种:$.unique() 第二种: for(var i = 0,len = totalArray_line.length;i < len;i++) {  !RegExp(totalArray_line[i],"g").test(resultArray_line.join(",")) && (resultArray_line.push(totalArray_line[i]));  }-----解决了V0…
1.radio:单选框 html代码 <input type="radio" name="radio" id="radio1" value="1" />1 <input type="radio" name="radio" id="radio2" value="2" />2 <input type="radio…
1.radio:单选框 HTML代码: <input type="radio" name="radio" id="radio1" value="1" />1 <input type="radio" name="radio" id="radio2" value="2" />2 <input type="radi…
1.radio:单选框 HTML代码: <input type="radio" name="radio" id="radio1" value="1" />1 <input type="radio" name="radio" id="radio2" value="2" />2 <input type="radi…
本文收集一些jquery的实用技巧,非常实用的哦,其中对radio.checkbox.select选中与取值的方法. 获取一组radio被选中项的值var item = $('input[@name=items][@checked]').val();获取select被选中项的文本var item = $("select[@name=items] option[@selected]").text();select下拉框的第二个元素为当前选中值$('#select_id')[0].sele…
相信很多人都用过jq的表单序列化serialize()方法,因为这能很方便地帮你把表单里所有的非禁用输入控件序列化为 key/value 对象,不需要你再去一个个地拼接参数了. 这是一个很好用的函数,用过的你肯定知道.但是ghostsf最近发现一个小bug(也许不应该叫bug,姑且称之).就是当radio或checkbox 未选中时,没有序列化到对象中. 什么原因呢?下面分析之:瞄一眼源码:From jQuery JavaScript Library v2.1.4 jQuery.fn.exten…
jQuery获取: jQuery.parent(expr),找父亲节点,可以传入expr进行过滤,比如$("span").parent()或者$("span").parent(".class") jQuery.parents(expr),类似于jQuery.parents(expr),但是是查找所有祖先元素,不限于父元素 jQuery.children(expr),返回所有子节点,这个方法只会返回直接的孩子节点,不会返回所有的子孙节点 jQuer…
原文:https://blog.csdn.net/Little_Stars/article/details/48624669 JS代码如下(点击事件依赖JQuery): //判断设备类型 $("#aass").click(function() { var browser = { versions: function() { var u = navigator.userAgent, app = navigator.appVersion; return { mobile: !!u.matc…