Jquery set attribute value

//The most frequently used jquery method to set the attribute value of the label

function setProperty(){

    $('#DIV3').attr("readonly",true);//Set the input element to readonly

    $('#DIV2').attr("disabled","disabled");//Set the input element to disabled

    $("#DIV1").css("display","none");//Set label hiding

    $("#DIV1 input").addClass("form-control");//Set the style of the label

    $(".form-control").removeClass("form-control").addClass("input");//Remove replacement style

    $('#DIV2').removeAttr("disabled");//Remove the disabled attribute of the input element

    $('#DIV3').removeAttr("readonly");//Remove the readonly attribute of the input element

    $("#DIV1").hide();//Hide

    $("#DIV1").show();//show

}

$('#children').parent().css('color','red')

$('#children').parent().addClass('class1')

$('#children').parent(‘.trbg’).addClass('class1')

 

$("input[name='cylb']") //获取<input type="radio" id="rzzz" name="cylb" value="1"/> 的值

$("input[name='cylb']").removeAttr("checked");//Remove the selection

$("input[name='cylb']").attr("disabled","disabled");//不可操作

Guess you like

Origin blog.csdn.net/oYuHuaChen/article/details/114256089