<li id="listItem"> This is some text <span id="firstSpan">First span text</span> <span id="secondSpan">Second span text</span> </li> 假设上面一段代码,我们想获取 'This is some text' 这段文本值, jq提供的方法是 text(…
打开新页面:window.location.href = "./index.html?id=1"获取携带值: function GetRequest() { var url = location.search; //获取url中"?"符后的字串 var theRequest = new Object(); if (url.indexOf("?") != -1) { //判断是否含有'?' var str = url.substr(1); //从字…
这是界面代码: function shua(){ var id_array=new Array(); $('input[id="checkAll"]:checked').each(function(){ id_array.push($(this).val());//向数组中添加元素 }); //获取界面复选框的所有值 var chapterstr = id_array.join(',…