JQuery常用操作HTML
$("li").each(function(){
alert($(this).text())
});
$('input[type="checkbox"][name="chk"]:checked').each(
function() {
a=a+"|"+$(this).val();
}
);
//var followers = document.getElementsByName("followers"); var f_str = '0'; $("input[@name='followers']").each(function(){ if($(this).attr("checked")==true){ f_str += ","+$(this).attr("value"); } })
$("input:checkbox").each(function(){
alert($(this).attr("checked"));
if($(this).attr("checked")=="checked"){
alert("哈哈,我被选中了");
}
https://www.sitepoint.com/jquery-check-checkbox-checked/
$("input[type=checkbox]").bind("click", function () {
var pid = $(this).attr("id");
var chk = $("#tppdesc").find("#" + pid + "d");
if (chk.length == 0)
$("#test_purpose_desc").before("<p><span><lable>" + $(this).attr("hiv") + ": </lable></span><input class='required' type='text' id='" + pid + "d' name='" + pid + "d' /></p>");
else
chk.parent().remove();
});
浙公网安备 33010602011771号