Webmaster Cash Program
 Upload & Sell Your Software
Upload & Sell Your Ebook
 Enter The AWT Service Center  Contact Applied Web Tools
 Purchase Some Advertising  Password Troubles? Click Here!
Knowledge Center
Want to write for Applied Web Tools? Send your Writer's Query to
Editor@AppliedWebTools.net for details.
HTML
Reference
&
Tutorial
CSS
Reference
&
Tutorial
DOM
Reference
&
Tutorial
JavaScript
Reference
&
Tutorial
50+ Programming Examples
Use HTML, CSS, DOM & JavaScript Together
Misc. Essays & Documents
You'll Find Just About Anything In Here
50+ Web Page Constructions
Learn the Art of Using HTML, CSS, DOM & JavaScript Together
 Changing Background Colors
 Event Triggering With onLoad
 Disabling The Right Click
 DOM Driven Color Changing
 Switching Images
 innerHTML Attribute Access
 Change With innerHTML
 Changing Positions
 Change Position With onMouseMove
 Change Text Position
 Interactivity Skills
 Type-writing A Message
 Auto-changing Text Size
 Making Text Scroll
 Blinking Text
 Simple Form Authentication
 Change Background Color Of An INPUT
 Change Text Color Of An INPUT
 Change Background Image Of An INPUT
 Select All Checkboxes
 Select Color Of The Submit Button
 Change Text Color Of A Submit Button
 Insert Background Image To A Button
 Change Color Of Drop Down List
 Change Text Color Of A Drop Down List
 Change Color Of A TEXTAREA
 Change The Text Color Of A TEXTAREA
 Insert An Image Into A TEXTAREA
 Change The Size Of An Image
 Change The Source Of An Image
 Change The Position Of An Image
 Change The Background Image
 Moving Images Around The Page
 Drag & Drop An Image
 A Simple Image Viewer
 A Shaking Image
 A Digital Clock
 Drop Down List Link
 Top Drop Down Menu
 Always On Top Menu
 Inset Border Buttons
 A Description Generating Menu
 An Image Generating Menu
 A Horizontal Sliding Menu
 A Click Horizontal Sliding Menu
 Returning Cursor Co-ordinates
 Making Text Follow The Cursor
 Attaching An Image To The Cursor
change inner HTML

The innerHTML attribute is sometimes a little confusing in its use, I’ve found. For some reason, outerHTML seems to be the best choice for most people, but this isn’t always the case – the proof for this is simply because the innerHTML attribute was included in the HTML specifications, not just the outerHTML attribute.

Use the id attribute to assign the JavaScript commands within the nameon() function to that individual page element. Call the name given as the value of the id attribute as the argument passed to the two functions we’re using to accomplish our goals. We use two events to trigger two separate actions, onMouseOut and onMouseOver.

<html>
<head>

<script type="text/javascript">
function nameon() {
document.getElementById('h2text').innerHTML="WELCOME!";
}
function nameout() {
document.getElementById('h2text').innerHTML="How are you today?";
}
</script>

</head>
<body>

<h2 id="h2text" onMouseOut="nameout()" onMouseOver="nameon()">Mouse over this text!</h2>

</body>
</html>


This is especially useful if you have an action that must change as the user triggers an event. You don’t have to stop with one command, remember, so you can load whatever functionality you’d like within the functions. The innerHTML attribute is used primarily as a text editing directive, but with a little forethought and creativity you can assign DOM style sheet rules when the text is changed. Each set of text you’d like to include as the changed content can have its own style sheet rules applied to it.
Want a copy of the Applied Web Tools Knowledge Center on your site?

Over 1200 individual command definitions in a really cool interface

Send your query to Sales@AppliedWebTools.net for details
I do not employ cookies or tracking devices of any kind