Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery find previous element with class

// HazaaZOOZ - jquery - How to find the previous element by or with class
// Example to find previous element by class and change the backgroud to yellow

 $( "p" ).prev( ".YourPreviousClass" ).css( "background", "yellow" );

 
PREVIOUS NEXT
Tagged: #jquery #find #previous #element #class
ADD COMMENT
Topic
Name
8+1 =