Top "Dom" questions

The Document Object Model(DOM) is a way to programmatically refer to the elements of a markup language like XML and HTML.

Count immediate child div elements using jQuery

I have the following HTML node structure: <div id="foo"> <div id="bar"></div> &…

javascript jquery dom jquery-selectors
onKeyPress Vs. onKeyUp and onKeyDown

What is the difference between these three events? Upon googling I found that: The onKeyDown event is triggered when the …

javascript dom dom-events
jQuery: select an element's class and id at the same time?

I've got some links that I want to select class and id at the same time. This is because I've …

jquery dom jquery-selectors css-selectors
Detect changes in the DOM

I want to execute a function when some div or input are added to the html. Is this possible? For …

javascript dom mutation-events mutation-observers
Finding the id of a parent div using Jquery

I have some html like this: <div id="1"> <p> Volume = <input type="text" /> <…

jquery dom semantics
Finding child element of parent pure javascript

What would the most efficient method be to find a child element of (with class or ID) of a particular …

javascript dom
How to find a parent with a known class in jQuery?

I have a <div> that has many other <div>s within it, each at a different …

javascript jquery html dom parent
Why is setTimeout(fn, 0) sometimes useful?

I've recently run into a rather nasty bug, wherein the code was loading a <select> dynamically via JavaScript. …

javascript dom event-loop
Select all elements with "data-" attribute without using jQuery

Using only JavaScript, what is the most efficient way to select all DOM elements that have a certain data- attribute (…

javascript html dom
Javascript callback when IFRAME is finished loading?

I need to execute a callback when an IFRAME has finished loading. I have no control over the content in …

javascript events dom iframe