Skip to content

Instantly share code, notes, and snippets.

@akmil
akmil / data-attr Listener
Created Feb 28, 2020
data-attr Listener
View data-attr Listener
const testDataAttrListener = function () {
function bindValue(objectToBind) {
const elemToBind = document.getElementById(objectToBind.id);
elemToBind.addEventListener("change", function () {
objectToBind.value = this.value;
console.log(this.value);
console.log("objectToBind", objectToBind);
});
}
View button theming using config-map.scss
$themes-names: (
primary: (
background: $white,
color: $dark-grey,
font-size: 18px,
),
dark: (
background: $dark,
font-size: 10px,
)
@akmil
akmil / inputTypeNumberPolyfill.js
Created Sep 14, 2016 — forked from nbouvrette/inputTypeNumberPolyfill.js
Stand alone JavaScript polyfill allow only numbers on input of type number.
View inputTypeNumberPolyfill.js
/**
* Stand alone polyfill allow only numbers on input of type number.
*
* While input filtering is already supported by default by some browsers, maximum length has not been implemented by
* any. This script will solve both issue and make sure that only digits can be entered in input elements of type
* number. If the optional attribute `max` is set, it will calculate it's length and mimic the `maxlength` behavior on
* input of type text.
*
* Supports:
*