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?

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

Emma Barton Net Worth: How Rich is the English Actress Actually?

Emma Barton Net Worth: How Rich is the English Actress Actually?

Emma Louise Barton is an English actress who is best known for playing the role of the character named Honey Mitchell in EastEnders. She is currently part of the seventeenth edition of the popular dance show called Strictly Come Dancing. As of 2019, Emma Barton net worth is estimated to be $2 million. Barton was […]

Alison Victoria Net Worth: How Rich is Alison Victoria Actually?

Alison Victoria Net Worth: How Rich is Alison Victoria Actually?

Alison Victoria is an interior designer and a television personality who is best known for being the host of the HGTV show called “Windy City Rehab” where she and lead contractor Donovan Eckhardt renovate different houses in Chicago and flip them. The series is set to release it’s season 2 in 2020. As of 2019, […]

Joey Buttafuoco Net Worth: How Rich is Buttafuoco Actually?

Joey Buttafuoco Net Worth: How Rich is Buttafuoco Actually?

Joey Buttafuoco is an American body shop owner who had a sexual relationship with minor Amy Fisher, who subsequently shot his wife Mary Buttafuoco in the face. As of 2019, Joey Buttafuoco net worth is estimated to be $800,000. Joey was born on March 11, 1956, in Massapequa, New York. He graduated from Massapequa High […]

%d bloggers like this: