Jquery
Jquery
1]The element Selector You can select all <p> elements on a page like this: $("p") 2]The #id Selector The jQuery #id selector uses the id attribute of an HTML tag to find the specific element. $("#test") 3]The .class Selector The jQuery class selector finds elements with a specific class. $(".test") ================================================================================ ====== jQuery Event Methods All the different visitors actions that a web page can respond to are called eve nts. Mouse Events Keyboard Events Form Events Document/Window Events
click keypress submit load dblclick keydown change resize mouseenter keyup focus scroll mouseleave blur unload =============================================================================== With jQuery you can fade elements in and out of visibility jQuery Fading Methods 1]jQuery fadeIn() Method The jQuery fadeIn() method is used to fade in a hidden element. 2]jQuery fadeOut() Method The jQuery fadeOut() method is used to fade out a visible elemen t. 3]jQuery fadeToggle() Method The jQuery fadeToggle() method toggles between the fadeIn() and fadeOut() methods. 4]jQuery fadeTo() Method The jQuery fadeTo() method allows fading to a given opacity (val ue between 0 and 1). ================================================================================ ================ jQuery Effects - Sliding The jQuery slide methods slides elements up and down. 1]slideDown() 2]slideUp() 3]slideToggle()
================================================================================ ================== jQuery Animations - The animate() Method ================================================================================ =========== jQuery - Chaining With jQuery, you can chain together actions/methods. Chaining allows us to run multiple jQuery methods (on the same element) within a single statement. To chain an action, you simply append the action to the previous action. ================================================================================ ================== jQuery - Get Content and Attributes: text() - Sets or returns the text content of selected elements html() - Sets or returns the content of selected elements (including HTM L markup) val() - Sets or returns the value of form fields Get Attributes - attr() The jQuery attr() method is used to get attribute values. ================================================================================ === jQuery - Set Content and Attributes text() - Sets or returns the text content of selected elements html() - Sets or returns the content of selected elements (including HTML ma rkup) val() - Sets or returns the value of form fields Set Attributes - attr() The jQuery attr() method is also used to set/change attribute values. ================================================================================ = jQuery - Add Elements jQuery append() Method jQuery prepend() Method Add Several New Elements With append() and prepend() jQuery after() and before() Methods
Add Several New Elements With after() and before() ================================================================================ = jQuery - Remove Elements remove() - Removes the selected element (and its child elements) empty() - Removes the child elements from the selected element