.test {
&:after { content: "hello"; }
&.clicked:after { color: red; }
}
var el = document.getElementsByClassName('element');
for(var i = 0; i < el.length ; i++){
el[i].addEventListener('click', function(e){e.target.classList.toggle('color')}, false);
}
<input type="checkbox" id="checkbox"><label for="checkbox">Test</label>
<style>
#checkbox {
display: none;
}
#checkbox:checked + label:before {
content: "* ";
}
#checkbox + label:before {
content: " ";
}
</style>
var x = {
key1: 12345678,
key2: "12345429",
key3: "2914180512305"
}
var f = Object.keys(x).filter(function(w) {
v = x[w];
if (typeof v !== "string") {
v = w.toString()
}
return w.match(/^1234\d{4}$/)
}).map(function(k) {
return x[k]
})var x = {
key1: 12345678,
key2: "12345429",
key3: "2914180512305"
}, f = [];
Object.keys(x).forEach(function(k, v) {
if (typeof v !== "string") {
v = v.toString()
}
if (v.match(/^1234\d{4}$/)) f.push(v)
})
var x = [12341, 12342, 12345, 'sdfdf', 3123, 12346];
var f = x.filter(function(v){return (v >= 12340 && v <= 12349)});
console.log(f); // -> Array [ 12341, 12342, 12345, 12346 ]