For the purposes of illustrating how to create an autonomous custom element, let's define a custom element that encapsulates rendering a small icon for a country flag. Our goal is to be able to use it like so
http://w3c.github.io/webcomponents/spec/custom/
// Left as an exercise for the reader.
https://codepen.io/blazejewicz/pen/EXLvjv/
@peterblazejewicz