Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery .prop() general attributes

0 votes
4 views
added Apr 2 in jQuery by LC Marshal Lieutenant (13,870 points)
$('#block-agent-contact input,#block-agent-contact textarea').prop("disabled", true);

1 Response

0 votes
responded Apr 5 by LC Marshal Lieutenant (13,870 points)
edited Apr 5 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.
...