<my-el></my-el>
class MyEl extends HTMLElement {

  constructor() {
    super();
    this.render();
  }
  get myObj() {
    return this._myObj;
  }
  set myObj(value) {
    this._myObj = value;
    this.render();
  }
  render() {
    this.innerHTML= `<span>hello</span>`;
  }
}

customElements.define('my-el', MyEl); 

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.