HomeОбразованиеRelated VideosMore From: Chidre'sTechTutorials

jQuery video tutorial 10 - jQuery CSS Method

20 ratings | 659 views
jQuery video tutorial 10 - jQuery CSS Method jQuery CSS() Method: The jQuery CSS() method is used to set one or more CSS style(s) to the selected HTML element(s). It is also used to get the value of a CSS style applied to the selected HTML element(s). Setting the single CSS style or property: Syntax: $(selector).css(“css-property”,”value”); It helps us to select any html element(s) targeted by the given selector and apply the given CSS property. Ex: $(“#firstp”).css(“background-color”,”red”); It selects any html element(s) whose id attribute value is set to firstp and applies the CSS property background color to red . Setting multiple CSS styles or properties: Syntax: $(selector).css({“css-property1”:”value1”,” css-property2”:”value2”,….}); It helps us to select any html element(s) targeted by the given selector and apply the given set of CSS properties. Ex: $(“#firstp”).css({“background-color”:”green”,”color”:”white”}); It selects any html element(s) whose id attribute value is set to firstp and applies the CSS properties background color green and text color white . Getting the value of a single CSS style or property: Syntax: $(selector).css(“css property”); It helps us to select any html element(s) targeted by the given selector and return the value of a given CSS property. Ex: alert($(“#firstp”).css(“background-color”)); It selects any html element(s) whose id attribute value is set to firstp and returns the value of background-color CSS property. The current implementation of the CSS() method in jQuery allows us to set multiple CSS properties to the selected HTML element(s), but only allows us to get one CSS property at a time. ========================================= Follow the link for next video: jQuery video tutorial 11 - jQuery selectors https://youtu.be/HpRdrhCq158 Follow the link for previous video: jQuery video tutorial 09 - jQuery syntax https://youtu.be/UvMuWgBzIHc =========================================
Html code for embedding videos on your blog
Text Comments (2)
Chidre'sTechTutorials (17 days ago)
SUBSCRIBE, SHARE & SUPPORT: https://www.youtube.com/chidrestechtutorials VISIT & LEARN AT FREE OF COST: ​https://www.chidrestechtutorials.com
Jedidiah barila (21 days ago)
hi there great video very helpfull but what about functions of it every selector

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.