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 4605612
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:27:18+00:00 2026-05-22T00:27:18+00:00

Couldn’t find a clear answer to what I’m trying to achieve. I’m sure it’s

  • 0

Couldn’t find a clear answer to what I’m trying to achieve. I’m sure it’s simple but I’m missing it.

I will be building a list of links on a page that all have the class of “prettyLink” and each will have a title. On mouseover I’m trying to store that title in a variable and remove the title, then on mouseout replace that title with what was stored. (basically removing the title while being moused over and putting it back when moused out)

here is the code:

$('a.prettyLink').mouseover(function() {
   var oldTitle = this.title;
   $(this).removeAttr('title');
}).mouseout(function() {
   $(this).attr('title',oldTitle);
});

Any help is appreciated. Thanks!

  • 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-22T00:27:19+00:00Added an answer on May 22, 2026 at 12:27 am

    Simply declare the variable outside of the mouseover() method:

    var oldTitle;
    $('a.prettyLink').mouseover(function() {
       oldTitle = this.title;
       $(this).removeAttr('title');
    }).mouseout(function() {
       $(this).attr('title',oldTitle);
    });
    

    JS Fiddle demo.

    Declaring the variable outside of the method allows the variable’s value to be assigned within the method, and have that new value be available elsewhere.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Couldn't find an answer to this question. It must be obvious, but still. I
I couldn't find anything on this, but probably its just because I don't know
I couldn't find a straight answer to my question and need to know it
Couldn't find similar enough question so I'll ask. I'm trying to use facebook log-in
couldn't find a similar topic but this may boil down to not knowing how
Couldn't find this anywhere, maybe I'm looking for the wrong verbs. I'm trying to
I couldn't find an answer anywhere on the Web, so I'm going to answer
Hi couldn't find it for C#, I am trying something like that for (int
I couldn't find this in the docs , but how am I meant to
Couldn't find the answer by serching (maybe bad keywords), so I am creating a

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.