jQuery provides .css() method to get and set the various CSS properties for the element. This method can be used to set one or multiple CSS properties for any element. You can also get the CSS property value using this method. In this post, I will show you all the 3 operations.
Set single CSS Property
Feel free to contact me for any help related to jQuery, I will gladly help you.
Set single CSS Property
//Code Starts $("p").css("background-color", "LightGrey"); //Code EndsSet multiple CSS Properties
//Code Starts $("span").css({"background-color": "Green","color":"Yellow"}); //Code EndsGet value of CSS Property
//Code Starts $("div").html($('span' ).css("font-size")); //Code EndsSee result below.
Feel free to contact me for any help related to jQuery, I will gladly help you.
No comments:
Post a Comment