How can I Observe the contents of an 'a' tag - jquery

后端 未结 4 958
轮回少年
轮回少年 2021-02-07 18:05
4条回答
  •  [愿得一人]
    2021-02-07 19:06

    What do you mean content of an a tag? You can do this like so:

    $('#linkElementID').html();
    

    or get an attribute like so:

    $('#linkElementID').attr("title"); //Title Attribute 
    $('#linkElementID').attr("href"); //href Attribute etc etc 
    

    I don't think there is an event that is fired when a tag changes, the .change() event is only fired by input areas and select lists.

    You would need to check after the event that loads the newly inserted content.

提交回复
热议问题