deact
Usage:
; const sayHi = console;const firstName = 'Moshe';const lastName = 'Kolodny';const todos = 'make todos list' 'something else?' ; const domElement = deact` <div> <h1>Hello </h1> <span onClick=>span1</span> <span OncLiCK=>span2</span> <ul> </ul> </div>`; documentbody;
DEMO (may need reloading with devtools open) source
How it works
The basic idea behind this is to take Tagged template strings and if the value is a function and it looks like an attribute then drop a placeholder. After doing that for all the items, inject the result into a div and replace each placeholder with it's corresponding real value
Note: since the template string must go through the browser's DOM engine, attributes are case insensitive
onClick === ONCLICK === oNcLiCk