JSFiddle - React, Tailwind, and code Playground

CSS

.ns-box-inner {
  border: 5px solid sienna;
  margin-bottom: 15px;
}

JavaScript

function extend( a, b ) {
    for( var key in b ) {
        if( b.hasOwnProperty( key ) ) {
            a[key] = b[key];
        }
    }
    return a;
}

function Notification( options ) {
    this.options = extend( {}, this.options );
    extend( this.options, options );
    this._init();
}

Notification.prototype.options = {
    wrapper : document.body,
    message : 'yo!',
    type : 'error',
    elements : {}
};

Notification.prototype._init = function() {
    var $this = this;
    this.html = document.createElement( 'div' );
    this.html.innerHTML = '<div class="ns-box-inner">' + this.options.message + '\
                           <div><a class="ns-box-link" href="javascript://">some link</a></div>\
                           </div>';

    this.options.elements.link = this.html.querySelector('.ns-box-link');

    this.options.elements.link.addEventListener('click', function() {
        console.log($this.options.elements.link);
        console.log($this);
    });

    this.options.wrapper.append(this.html);
}

var ntfc1 = new Notification({
	message: '<p>This is just a simple notice. <a href="#">simple link</a>.</p>',
	type: 'notice'
});

var ntfc2 = new Notification({
  message: 'Hello world',
  type: 'error'
});