codehaven - php snippets - coding help
Generic filters
Exact matches only

Get ID or SRC of Closest Div or LI

12th June 2014

Jquery - Variables

jquery icon

This id

This first one gets the id of the closest li


This will start from where clicked, and go up to the first .mybutton, then find .fakes class inside.


Get the image url value from class name

Get the image name/src/alt tag from an image inside a class


Hides the closest element with the classname .deleteitem


Affect the opacity of an image


This snippet will find the clicked elements – next elements class called “.item” and get the src the image with that class name!

Get ID of next DIV up

Was this code snippet helpful?