帮忙拼接个字符串 html代码想得到的效果是:1=,2,3|4=,5,6,7 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 分别去除pid为和4的然后再组装 怎么不copy代码进来 弄一张图片 复制都复制不到。 <tr> <td>订单管理</td> </tr> <tr> <td> <input type="hidden" value="1" id="pper1" name="pper"/> <input type="checkbox" name="per" value="2" pid="1" id="per2" />门票订单管理 <input type="checkbox" name="per" value="3" pid="1" id="per3" />套餐订单管理 </td> </tr> <tr> <td>网站常规管理</td> </tr> <tr> <td> <input type="hidden" value="4" id="pper4" name="pper"/> <input type="checkbox" name="per" value="5" pid="4" id="per5" />热门标签管理 <input type="checkbox" name="per" value="6" pid="4" id="per6" />城市管理 <input type="checkbox" name="per" value="7" pid="4" id="per7" />flash图片管理 <input type="checkbox" name="per" value="8" pid="4" id="per8" />友情链接管理 <input type="checkbox" name="per" value="9" pid="4" id="per9" />网站页脚管理 <input type="checkbox" name="per" value="10" pid="4" id="per10" />图片管理 </td> </tr> <script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script><script type="text/javascript"> $(function(){ var str1=""; var str2=""; $("input[name='per']").each(function(index, element) { if($(this).attr("pid")==1){ str1+=","+$(this).val(); } if($(this).attr("pid")==4){ str2+=","+$(this).val(); } }); alert(str1+"|"+str2); });</script> 无语了<script type="text/javascript"> $(function(){ var str=""; $("input[name='pper']").each(function(index, element) { var pid=$(this).val(); $("input[name='per']").each(function(index, element) { if($(this).attr("pid")==pid){ str+=","+$(this).val(); } }); str+="|"; }); if(str!=""){ str = str.substring(0,str.length-1); } alert(str); });</script> 亲,光靠别人不好哟!!怎么不自己改改$(function(){ var str=""; $("input[name='pper']").each(function(index, element) { var pid=$(this).val(); str +=pid+"="; $("input[name='per']").each(function(index, element) { if($(this).attr("pid")==pid){ str+=","+$(this).val(); } }); str+="|"; }); if(str!=""){ str = str.substring(0,str.length-1); } alert(str); }); ckeditor ckfinder配置 有什么办法实现这样的效果 关于HTML与屏目分辨率兼容问题 jq达人请进,可RMB结算 js写的地震预警,大家帮忙测试一下 怎么样在图片上加一个删除小图片 取日期的代码有什么错误 高手帮忙!我写的这个ajax表单提交模块是否存在内存泄漏问题?如能找到此bug百分相赠! 帮忙啊,怎么做关联的listbox啊 javascript:void(0)在此外的用意是啥 晕!我竟然无法赠送分数,请showbo版大进来发言留名,我好给分数!谢过先。 Share一个照片轮转抽奖的小网页
<tr>
<td>订单管理</td>
</tr>
<tr>
<td>
<input type="hidden" value="1" id="pper1" name="pper"/>
<input type="checkbox" name="per" value="2" pid="1" id="per2" />门票订单管理
<input type="checkbox" name="per" value="3" pid="1" id="per3" />套餐订单管理
</td>
</tr>
<tr>
<td>网站常规管理</td>
</tr>
<tr>
<td>
<input type="hidden" value="4" id="pper4" name="pper"/>
<input type="checkbox" name="per" value="5" pid="4" id="per5" />热门标签管理
<input type="checkbox" name="per" value="6" pid="4" id="per6" />城市管理
<input type="checkbox" name="per" value="7" pid="4" id="per7" />flash图片管理
<input type="checkbox" name="per" value="8" pid="4" id="per8" />友情链接管理
<input type="checkbox" name="per" value="9" pid="4" id="per9" />网站页脚管理
<input type="checkbox" name="per" value="10" pid="4" id="per10" />图片管理
</td>
</tr>
<script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(function(){
var str1="";
var str2="";
$("input[name='per']").each(function(index, element) {
if($(this).attr("pid")==1){
str1+=","+$(this).val();
}
if($(this).attr("pid")==4){
str2+=","+$(this).val();
}
});
alert(str1+"|"+str2);
});
</script>
<script type="text/javascript">
$(function(){
var str="";
$("input[name='pper']").each(function(index, element) {
var pid=$(this).val();
$("input[name='per']").each(function(index, element) {
if($(this).attr("pid")==pid){
str+=","+$(this).val();
}
});
str+="|";
});
if(str!=""){
str = str.substring(0,str.length-1);
}
alert(str);
});
</script>
$(function(){
var str="";
$("input[name='pper']").each(function(index, element) {
var pid=$(this).val();
str +=pid+"=";
$("input[name='per']").each(function(index, element) {
if($(this).attr("pid")==pid){
str+=","+$(this).val();
}
});
str+="|";
});
if(str!=""){
str = str.substring(0,str.length-1);
}
alert(str);
});