hyperElement

Example of hyperElement (hyperHTML+CustomElements)

by codemeasandwich

HTML

<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/webcomponentsjs@latest/lite.min.js"></script>
<script src="https://unpkg.com/hyperhtml@latest/index.js"></script>
<script src="https://unpkg.com/hyper-element@latest/source/hyperElement.js"></script>
<script src="https://cdn.rawgit.com/blueimp/JavaScript-MD5/master/js/md5.min.js"></script>
<baby-tag name="AshlynKarina" age="5months" >   </baby-tag><br/>
<baby-tag name="Tinen" age="comming soon" >   </baby-tag>

JavaScript 1.7

document.registerElement("baby-tag",class extends hyperElement{

       render(Html){
        Html`
        hello ${this.attrs.name}
        angel ${this.attrs.age}
        `
       }
  })