在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
<script src="http://code.jquery.com/jquery-1.4.4.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $(":checkbox").each(function (i) { if (this.id.indexOf("cbl") != -1) { this.onclick = function () { AddTips(this.id) }; } }); // var Tips = document.getElementById("Tips"); // Tips.innerHTML = ""; $("#Tips").html(""); }); function AddTips(Id) { //var Tips = document.getElementById("Tips"); var $Tips = $("#Tips"); $("label").each(function (i) { if (this.htmlFor == Id) { if ($("#" + Id).is(":checked")) { $Tips.html($Tips.html() + $(this).html() + ","); } else { var x = $(this).html() + ","; $Tips.html($Tips.html().replace(x, "")); } } }); // var items = $("label"); // for (var i = 0; i < items.length; i++) { // if (items[i].htmlFor == Id) { // if (document.getElementById(Id).checked) { // Tips.innerHTML += items[i].innerHTML + ","; // } // else { // var x = items[i].innerHTML + ","; // Tips.innerHTML = Tips.innerHTML.replace(x, ""); // } // } // } } </script> <div > CS.
|
请发表评论