js页面拼接多个checkbox的值

 var conType = "";
 var conTypes = document.getElementsByName("contact_Type");
 for(var i = 0;i < conTypes.length ; i ++){
  if (conTypes[i].checked){
   conType = conType+conTypes[i].value+",";
  }
 }
 conType = conType.substring(0,conType.length-1);

posted @ 2014-03-24 15:18  flydico  阅读(429)  评论(0编辑  收藏  举报