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.

Executing <script> elements inserted with .innerHTML

I've got a script that inserts some content into an element using innerHTML. The content could for example be: <…

javascript dom eval innerhtml
How to check if element has any children in Javascript?

Simple question, I have an element which I am grabbing via .getElementById (). How do I check if it has any …

javascript dom
Understanding offsetWidth, clientWidth, scrollWidth and -Height, respectively

There are several questions on StackOverflow regarding offsetWidth / clientWidth / scrollWidth (and -Height, respectively), but none give comprehensive explanation of what …

html css dom
jquery - fastest way to remove all rows from a very large table

I thought this might be a fast way to remove the contents of a very large table (3000 rows): $jq("tbody", …

javascript jquery dom
How to destroy a DOM element with jQuery?

Suppose the jQuery object is $target.

jquery dom
Focus Input Box On Load

How can the cursor be focus on a specific input box on page load? Is it posible to retain initial …

javascript html dom xhtml
How to Implement DOM Data Binding in JavaScript

Please treat this question as strictly educational. I'm still interested in hearing new answers and ideas to implement this tl;…

javascript html dom data-binding
Difference between DOM parentNode and parentElement

Can somebody in explain me in as simple as possible terms, what is the difference between classical DOM parentNode and …

javascript firefox dom
jQuery .live() vs .on() method for adding a click event after loading dynamic html

I am using jQuery v.1.7.1 where the .live() method is apparently deprecated. The problem I am having is that when …

javascript jquery events dom handler
jQuery - Trigger event when an element is removed from the DOM

I'm trying to figure out how to execute some js code when an element is removed from the page: jQuery(…

jquery events dom triggers