JSFiddle - React, Tailwind, and code Playground

HTML

<a href="#">foobar</a>
<button id="content">change content</button>
<button id="href">change href</button>

JavaScript

var $a = $('a');

$a.one('DOMNodeInserted', function(e) {
    console.log('content changed!: ', e);  

    console.log('new content: ', $(this).html());
});

$a.one('DOMAttrModified', function(e) {
     console.log('attribute changed!: ');        
    
     console.log('attribute that was changed: ', e.attrName);
});

$('#content').bind('click', function() {
    $a.text('hello world');           
});

$('#href').bind('click', function() {
    $a.attr('href', 'http://www.google.com');
});