![]() |
Dynamically Changing content![]() ![]() ![]() ![]() ![]()
Changing web page content is a great way to provide context-specific information
to the user. You make text content changes through a Dynamic HTML
mechanism called HTML replacement, The key to HTML replacement is Dynamic
HTML's approach to defining the existing HTML tags and text in a text block as
an object that you can change dynamically by an on-page script routine.
Every HTML tag pair that can contain text can be used for HTML content replacement, You identify the elements you want to change dynamically by instantiating them as objects through the I D= attribute. You then have four text element properties at your disposal to dynamically change the contents within the element's tag pair. An HTML element tag pair can change the four following properties:
innerHTML You can then use the following line in a script function to reference the existing I <B>Iove </B><I>Dynamic HTML </I> HTML tags and text within the paragraph text block and change the contents: PG1. innerHTML= as much as 1 <B>Iove </B> breathing"; It is important to understand exactly what an element range defines. An element is any HTML tag or tag pair that is parsed and treated as a unique item on a page. An element differs from an object in that an element is an object only if it is named with an ID attribute. The range is the span of influence an element has within the Web page. The range of a text block or section is defined by the HTML tags and text that appear between the opening and closing tags of the tag pair. The innerHTML property defines the contents of an element object with HTML tags and maintains the existing tags that define the element. The outerHTML property also defines the contents of an element object with HTML tags, yet replaces the element itself with the outer tags identified in the assignment string. The innerText property defines new contents of an element, but evaluates the assignment string as text only. The outerText property defines new contents of an element and eliminates the element tags in the process. The outerText property also evaluates the assignment string as text only. Any tags placed in the assignment string will appear as text on the page if you use the innerText or outerText properties. Therefore, changing the inner HTML property of the PG1 paragraph maintains the <p></p> tag pair as part of the page.
|
|
Domain NamesDHTML Document Object Model Features of Dynamic HTML HTML Versus DHTML Netscape's Vision of DHTML Microsoft Vision of DHTML Cascading Style Sheets(CSS) Inline Style Sheets Embedded Style for a Page Linked Cascading Style Sheet Text Specific Style AttributesCSS Attributes Assigning Classes Java Script Style Sheets(JSSS) Object Property Functions Methods
Creating Style Sheets with JSSS New JSSS Methods Working Layers Positioning the Layer Using More than One Layer Moving a Layer Around on the Page Events
The mouseOver and mouseOut Events The mouseMove Event The Keyboard Events The mouseDown and mouseUp Events The dragDrop Event Error Event Form Event The Script Tag Changing Text Color Inline Text Attribute Changes Text Dynamically Changing StylesExample of Dynamically Changing Style Dynamically Changing Content HTML Replacement Changing Text Content An Example of HTML Graphics ReplacementWeb DesignWeb HostingE Commerce |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |