Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7075761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:12:58+00:00 2026-05-28T06:12:58+00:00

I have multile li tags (Around 24) – and within them, is an image,

  • 0

I have multile li tags (Around 24) – and within them, is an image, and a p tag…

My quetion is…

If I hover over the li e.g. the li itself, the image within or the p…how can I add a class to the p tag?

<li>
<img src="" alt="" />
<p>sometexthere</p>

and then when I hover over any of those elements of that li, the p get’s a class added to it e.g.

<li>
<img src="" alt="" />
<p class="newclass">sometexthere</p>

Note: That it can only be applied to the current li’s p not make the change to all the p’s within all 24 li’s… – Just the current hovered block.

Basically i’m looking just to change the background of the p…so a bonus would to be able to switch class, but with a fade effect (If possible?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:12:58+00:00Added an answer on May 28, 2026 at 6:12 am
    $('li').hover(function() {
      $('p', this).toggleClass('new-class');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a model where an article can have multiple tags (and a tag
Consider following two tables: tag_names (tag_id, tag_name) tag_links (tag_id, image_id) An image can have
I have a many-to-many relationship between photos and tags: A photo can have multiple
I have multiple data items, each with a value V that has multiple tags
Let us say that I have a form to search by multiple tags in
I have a selectbox with the multiple attribute set. I'm also using <optgroup> tags
I have multiple forms on a page where each form will add individual item
Ok. I'm new to MySQL have a SELECT statement I can't wrap my head
Say I want to model a system where a piece of data can have
I have multiple anchor tags on my web page and I am currently using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.