I want find the index of a given DOM node. It\'s like the inverse of doing
document.getElementById(\'id_of_element\').childNodes[K]
I want
The shortest possible way, without any frameworks, in all versions of Safari, FireFox, Chrome and IE >= 9:
var i = Array.prototype.indexOf.call(e.childNodes, someChildEl);