This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let _str = (function(){ | |
const tag = document.createElement('span') | |
return { | |
propToAttr: (string) { | |
tag.dataset[string] = true | |
return tag.attributes[0].name.split(/^data-/)[1] | |
}, | |
attrToProp(string) { | |
tag.setAttribute(`data-${string}`, true) | |
return Object.entries(tag.dataset)[0][0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Hitch Demo</title> | |
<meta charset="utf-8"> | |
<script src="https://hitchjs.com/dist/hitch-0.6.3.js"></script> | |
<style type="text/css" data-hitch-interpret> | |
@-hitch-requires https://www.hitchjs.com/use/bkardell.math/1; | |
.car:-math-lessthan(data-price, 200000){ |