Select previous sibling via jQuery
How to select previous sibling via jQuery?
An enthusiastic, adaptive, and fast-learning person with a broad and acute
interest in the discovery of new innovative drugs, I particularly enjoy
collaborating with scientists from different disciplines to develop new skills
and solve new challenges.
Aryan Kumar
27-Nov-2023In jQuery, you can use the .prev() method to select the immediately preceding sibling of an element. Here's an example:
In this example:
Make sure to include the jQuery library in your HTML file for this to work. You can adjust the selector and styling based on your specific use case.