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

后端 未结 4 957
轮回少年
轮回少年 2021-02-07 18:05
4条回答
  •  一整个雨季
    2021-02-07 18:59

    You can try monitoring the .html() of the tag to see if it changes to anything else...

    Maybe have a timed function (executing every n-seconds) that monitors the content (.html()) of the element until it changes and then stops monitoring it. Maybe something in the vein of:

    var monitor = true;
    var doMonitor = function() {
      monitor = $("#theanchor").html() != "the initial value";
      if (monitor)
        setTimeout(doMonitor,500);
    };
    setTimeout(doMonitor,500);
    

    In theory this should work, but I haven't tested it.

提交回复
热议问题