Advertisements
Connect with us

Tips & Tricks

Remove the title attribute using jQuery

In WordPress, when you use wp_page_menu your anchor attribute’s usually carry a title with the same name. I’m not sure if it’s correct to do this, but it bother me when I hover over a page menu navigation link and I get a hover of the title.

So on my site I used jQuery to remove the title:

$("#nav a").removeAttr("title");

Pretty simple huh?

Advertisements
7 Comments

7 Comments

  1. Bryan

    March 11, 2009 at 9:32 pm

    Hey, yeah, that’s really simple! Right now I’m doing…

    $clean_pages = wp_list_pages(‘title_li=&&echo=0’);
    $clean_pages = preg_replace(‘/title=\”(.*?)\”/’,”,$clean_pages);
    echo $clean_pages;

    • Frosty

      March 12, 2009 at 12:55 pm

      Yes, a lot easier, but it won’t work on any browser that has javascript disabled.

  2. andy

    March 21, 2009 at 11:25 am

    correct me if i am wrong please….do i just put this code in my head section:

    $(“#div_id”).removeAttr(“title”);

    and that should remove the title attribute from displaying when I hover over any item within the #div_id ?

    Note: it is not an a tag I am trying to remove the title attribute from, but rather a div tag.

    • Austin

      March 21, 2009 at 2:24 pm

      Yes, the removeAttr should remove any title attribute if there is one, as long as javascript is enabled.

    • Unibands

      October 29, 2009 at 5:08 am

      Yes, but you of course need the jQuery library too. And you put this like so in your tags.

      //

  3. Unibands

    October 29, 2009 at 5:12 am

    Seems like code etc doesn’t show up in the comments.

  4. Pingback: Remove WordPress Title Attribute | ClayCazier.com

You must be logged in to post a comment Login

Random Search Terms

Title

Top Articles

powered by WassUp

Recent Posts: Fully Net Worth . com

Angie Varona What you dont know.

Angie Varona What you dont know.

Angie Varona Angie Varona is a model, social media influencer, and sex symbol. Who become famous online at the young age of 14 when someone hacked her Photobucket account where she had pictures of her in bra and panties that were taken for her boyfriend at the time. These pictures quickly went viral, causing Angie […]

Peter Morton Net Worth: How Rich is Harry Morton’s Father?

Peter Morton Net Worth: How Rich is Harry Morton’s Father?

Peter Morton is an American businessman best known as the co-founder of the Hard Rock Café and also a chain of dining restaurants. As of 2019, Peter Morton net worth is estimated to be $800 million. Peter was born on August 7, 1947, in Chicago, Illinois. He is the son of Arnie Morton, founder of […]

AzChike Net Worth: How Rich is the Rapper from Los Angeles?

AzChike Net Worth: How Rich is the Rapper from Los Angeles?

AzChike is an American rapper who is from South Central, Los Angeles. He is best known for his hit songs “Burn Rubber Again” and “Licked Up”. As of 2019, AzChike net worth is estimated to be $250,000. Growing up, he loved to ride bikes and was a social kid who liked to have fun with […]

%d bloggers like this: