jQuery .prop() general attributes

0 votes
212 views
added Apr 2, 2018 in jQuery by LC Marshal Captain (25,790 points)
$('#block-agent-contact input,#block-agent-contact textarea').prop("disabled", true);

1 Response

0 votes
responded Apr 5, 2018 by LC Marshal Captain (25,790 points)
edited Apr 5, 2018 by LC Marshal

Add and remove a property named "color":

$(document).ready(function(){
    $("button").click(function(){
        var $x = $("div");
        $x.prop("color", "FF0000");
        $x.append("The color property has the following value: " + $x.prop("color"));
        $x.removeProp("color");
        $x.append("<br>Now the color property has the following value: " + $x.prop("color"));
    });
});
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...