The enduring popularity of this question on Stackoverflow: How to do this using jQuery – document.getElementById(“selectlist”).value took me back to the very first issue I had with jQuery. Namely: Why on earth does $(“myid”) not give me the DOM object for “myid” like document.getElementById(“myid”)? In fact it gives you a collection of … Continue reading
Tag Archives: jQuery
Posts about the the jQuery JavaScript library
Manually Traverse a DOM Tree Using jQuery
Image via Wikipedia jQuery does a wonderful job of traversing the DOM tree, so you might ask why you would like to do this yourself? I recently encountered a requirement to count the maximum ‘depth’ of a DOM tree. I.e. find the level of the deepest nested element. So, I … Continue reading