Is it possible to hide the title from a link with CSS?

后端 未结 5 958
孤独总比滥情好
孤独总比滥情好 2020-12-06 04:17

I have an anchor element with a title attribute. I want to hide the popup that appears when hovering over it in the browser window. In my case, it is not possible to do some

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 04:41

    In CSS it's not possible, because you can only add contents to DOM (tipically with :before :after and content: '...';, not remove or change attributes.

    The only way is to create a live custom event (es. "change-something"):

    $("a").on("change-something", function(event) { this.removeAttr("title"); });

    and trigger to every changes:

    ... $("a").trigger("change-something");

    More information and demo here:

    http://api.jquery.com/trigger/
    http://api.jquery.com/removeAttr/

提交回复
热议问题