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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:08:18+00:00 2026-06-15T08:08:18+00:00

Currently I’m developing a custom tooltip for my website. It’s a heavy one, so

  • 0

Currently I’m developing a custom tooltip for my website. It’s a heavy one, so it has around 300 elements with title on every page. And It’s working well with this code:

var title="";
$( document ).delegate( "[title]", "mouseover", function ( event ) {
    title = $( this ).attr( "title" );
    $( "#tooltip-div" ).delay( 250 ).animate( { top: newTop, opacity: 1 }, 'fast' );
 } );
    

But the problem I’m facing is:
Unfortunately, there are many elements in the page which have the title attribute, but empty. For example:

<input type="image" id="clearBtn" title="" src="../../Images/unsearch.png" onclick="clearFilter();">
    

For this element, my custom tooltip is showing up with an empty value.
So I was wondering if there is any way to select elements which have the ‘title’ attribute and that attribute is not empty.

So I want to exclude the elements like the one I show above. Is there a way to do that directly using a JQuery Selector, to make sure that I bind the event only to my desired elements, other that checking the length of title attribute inside the event handler.

  • 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-06-15T08:08:19+00:00Added an answer on June 15, 2026 at 8:08 am

    Here’s a possible solution, requiring a [title], and a [title!=''].

    var title="";
    $( document ).delegate("[title][title!='']", "mouseover", function ( event ) {
        title = $( this ).attr( "title" );
        $( "#tooltip-div" ).delay( 250 ).animate( { top: newTop, opacity: 1 }, 'fast' );
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I'm starting a new Activity and calling finish on a current one. Is
Currently I am trying to use a bunch of custom perl modules, test.pm as
Currently, my MVC 3 app has a dependency on a static class that is
Currently, I have a log file of messages in one table in a MySQL
Currently, I use an abstract factory to allow the specification of a custom class
Currently, I am modifying a css document to make a website compatible in IE
currently I'm developing an app for WP7 but came across a little problem with
Currently my query is very heavy, the table (table A) I need to update
Currently, the only information I have is a one-line error message in the browser's
Currently I have one Windows Azure Cloud Service Project (Service1) that will put messages

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.