♦ jQuery parent()
♣ Example1: jQuery parent()
Below is the representation of jQuery parent() Syntax.Basic Syntax
$(selector).parent().event(function(){
//code_block
});
//code_block
});
Syntax Explanation:
selector : the element of which parent is to be selected
event : this can be events(click, hover, etc) or css or addClass, etc
code_block : code to executed on parent tag
In this example, the just parent border of level 4 is blue-colored.event : this can be events(click, hover, etc) or css or addClass, etc
code_block : code to executed on parent tag
Example
Input:
Output: