jquery prev()
// HazaaZOOZ - jquery - How to get the Previous element of element by class name jquery
//Example to make the backgroud into yellow
$(document).ready(function(){
$("li.start").prev().css( "background", "yellow" );;
});
jquery prev()
// HazaaZOOZ - jquery - How to get the Previous element of element by class name jquery
//Example to make the backgroud into yellow
$(document).ready(function(){
$("li.start").prev().css( "background", "yellow" );;
});
jquery prev
// The prev() method returns the previous sibling element of the selected element.
jQuery(li['class="foo"']).prev()
// some related methods:
jQuery(selector).prevAll() // returns all previous sibling elements of the selected element
jQuery(selector).prevUntil() // returns all previous sibling elements between two given arguments
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us