Posts tagged 〝webdevtrick〞

(page 7 of 12)

The only for loop you will ever need °

April 2nd, 2007 at 10:03 pm

A tongue-in-cheek look at JavaScript loop patterns: caching length, reverse and while loops, and a lis[0] condition that safely removes live DOM nodes.


Q&A - Dynamically assigning CSS Floating in JavaScript

April 2nd, 2007 at 5:09 pm

Floating a DOM element from JavaScript means using style.cssFloat (not float), but a class name and CSS rules are the more maintainable fix for IE quirks.


Q&A - Internet Explorer keyboard navigation doesn\’t work

April 2nd, 2007 at 5:06 pm

Why Internet Explorer scrolls to in-page anchors without moving keyboard focus, and how hasLayout containers or a tabindex of -1 fix accessible TOC links.


Determining the depth of a nested HTML list

March 26th, 2007 at 3:29 pm

A short JavaScript function that finds the maximum nesting depth of a nested UL menu using getElementsByTagName, with a test case to try.


Q&A - How can I track the change in a form field before the form was submitted

February 12th, 2007 at 11:33 am

Detect edited form fields in JavaScript on submit by comparing each field's defaultValue with its current value, instead of storing values on page load.