var elements = document.getElementsByClassName("asd"),
length_of_elements = elements.length,
setContent = function(){
this.innerHTML = 'lol';
}, i;
for (i=0;i<length_of_elements;i++) {
elements[i].addEventListener('click',setContent,false);
}
var t
keyAction = function(e) {
return (t = actions[e.keyCode]) && t(e)
}
$(document).on("keydown", function(event) {
return actions[event.which] && actions[event.which](event);
});
var t
keyAction = function(e) {
return (t = actions[e.keyCode]) && t(e)
}
var body = document.body, html = document.documentElement;
var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
jQuery.fn.extend({
'offsetBottom' : function() {
var d = $( document ), t = $( this );
return d.height() - t.offset().top - t.height()
},
'offsetRight' : function() {
var d = $( document ), t = $( this );
return d.width() - t.offset().left - t.width()
}
})
$( some-element ).offsetBottom().offsetRight()
...
<section data-purpose="sports">
<header>
<p>Here is a header for the sports section.</p>
</header>
<article data-theme="some-theme">
...
</article>
<article data-theme="some-other-theme">
...
</article>
<footer>
<p>That's all, folks!</p>
</footer>
</section>
...
...
<div class="section">
<div class="section-header">
<p>Here is a header for the sports section.</p>
</div>
<div class="section-article" id="some-theme">
...
</div>
<div class="section-article" id="some-other-theme">
...
</div>
<div class="section-footer">
<p>That's all, folks!</p>
</div>
</div>
...