//获取url中的参数function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var r = window.location.search.substr(1).match(reg); //匹配目标参数 if (r != null) return unescape(r[2]); return
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <ti
这是界面代码: function shua(){ var id_array=new Array(); $('input[id="checkAll"]:checked').each(function(){ id_array.push($(this).val());//向数组中添加元素 }); //获取界面复选框的所有值 var chapterstr = id_array.join(',
js获取单选按钮的值 function getVals(){ var res = getRadioRes('rds'); if(res == null){mui.toast('请选择'); return;} mui.toast(res); } function getRadioRes(className){ var rdsObj = document.getElementsByClassName(className); var checkVal = null; for(i = 0; i < rd
//获取单选和复选框的值//parameters.type:"radio","checkbox"//parameters.name:input-name//parameters.flag:"0"-val,"1"-textfunction getCheckedValue(parameters) { var type = parameters.type; var name = parameters.name; var flag =
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <mce:style><!-- --></mce:style><style mce_bogus="> </style> <t
<title>CheckBox</title> <script type = "text/javascript"> doGetVal: function doGetVal() { //var fruitName = document.getElementById("apple").value;//根据ID获取值 //alert(fruitName); // var fruit = document.getElementsByNam