/Highlight-Previous-Div-with-jQuery

This HTML document demonstrates a simple jQuery script for highlighting the previous <div> element when any <div> is clicked. If the clicked <div> is the first one, it changes its own background color and displays an alert message.

Primary LanguageHTML

Highlight-Previous-Div-with-jQuery

This HTML document demonstrates a simple jQuery script for highlighting the previous <div> element when any <div> is clicked. If the clicked <div> is the first one, it changes its own background color and displays an alert message. The page features multiple

elements styled with CSS to have borders and padding. The jQuery script handles the click event on each
, changing the background color of the previous sibling
to green, or displaying an alert if the clicked
is the first one.