OK, we’ve been delving into Cascading Style Sheets for the last few weeks, so let’s get down and let’s get dynamic with CSS. And to do this we need to enter the world of dynamic HTML (DHTML) – essentially HTML manipulated by JavaScript, VBScript or any other browser scripting language.OK, we’ve been delving into Cascading Style Sheets for the last few weeks, so let’s get down and let’s get dynamic with CSS. And to do this we need to enter the world of dynamic HTML (DHTML) – essentially HTML manipulated by JavaScript, VBScript or any other browser scripting language.Before we dive into that topic, we need to extend the concept of HTML tags to include tags that have no properties. The reason this matters is that all standard HTML tags come with a property set. But those properties will affect the presentation, and you probably don’t want to have to go to the trouble of redefining them. To get around this problem there are two special tags: and .The division tag, , was added in HTML 3.2 and is much like and , but where creates a paragraph break before the following text, and do not. Try saving the following in a file and then loading it into your browser:This is line one This is line twoThis is line threeThis is line fiveNote that does not have an associated end tag (), but both and do. This means both tags define a region of a document but is cleaner, as it has less effect on content. On the other hand, , which was added in HTML 4.0, is even cleaner because it doesn't cause a line break.And like any other tags, and can have IDs and classes assigned to them. For example:#something { ... }span.nothing { ... } ... ... DHTML is not a standard; it is a marketing term that Netscape coined and Microsoft adopted to describe some new features of its browsers from Version 4 onward.Of course, there is a consequence of this being a marketing term: You can kiss compatibility goodbye. Well, you can kiss complete compatibility goodbye, as there is significant commonality between the implementations - most things you want to do with DHTML will work in either browser. But the devil is in the details . . . and in the bugs in the browsers (which are problems that are not just cross-vendor but cross-version as well - but what did you expect?).Underpinning DHTML is the document object model (DOM), a map of the contents of a Web page. The DOM is a schema that provides a way of identifying the components that make up a given Web page starting from the root object and decomposing into sub-objects.At the root of the DOM is the browser window named (no surprise) window, and any element must start with the object window. So to get to the elements in a document displayed in a browser, we refer to a path that begins "window.document" although just "document" is usually used.So let's say you have a button defined such as:This image is a named element under the images objects branch of the DOM, and you would refer to it as window.document.images.pic1 or document.images.pic1. Changing this element with JavaScript is as simple as this:document.images.pic1.src="pic1state2.gif"This means you can dynamically change the properties of an on-screen element under IE4+ and NS6+. Moreover, under IE4+ and NS4+ you can hide or show elements, change the Z-index (the depth of elements on screen), control the position of elements, move elements on screen and let users move screen elements. And for IE5+ and NS4+, you can change the clipping of an object - the amount of the object that is displayed.As you might guess, there are many differences between the DOMs of Microsoft, Netscape and other browser vendors. For example, below the window object under Internet Explorer and Netscape browsers are the object's document, history and location. Then the browser's DOMs part ways: The Netscape DOM also has frames at this level, while Microsoft's DOM includes toolbar, packages and navigator.For the purposes of manipulating content though, we are concerned only with the document branch of the DOM, and here is where standards exist, which we'll discuss next week.Styled comments to gearhead@gibbs.com. Related content feature 5 ways to boost server efficiency Right-sizing workloads, upgrading to newer servers, and managing power consumption can help enterprises reach their data center sustainability goals. By Maria Korolov Dec 04, 2023 9 mins Green IT Green IT Green IT news Omdia: AI boosts server spending but unit sales still plunge A rush to build AI capacity using expensive coprocessors is jacking up the prices of servers, says research firm Omdia. By Andy Patrizio Dec 04, 2023 4 mins CPUs and Processors Generative AI Data Center feature What is Ethernet? History, evolution and roadmap The Ethernet protocol connects LANs, WANs, Internet, cloud, IoT devices, Wi-Fi systems into one seamless global communications network. By John Breeden Dec 04, 2023 11 mins Networking news IBM unveils Heron quantum processor and new modular quantum computer IBM also shared its 10-year quantum computing roadmap, which prioritizes improvements in gate operations and error-correction capabilities. By Michael Cooney Dec 04, 2023 5 mins CPUs and Processors CPUs and Processors CPUs and Processors Podcasts Videos Resources Events NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe