Javascripts > Javascript Forms > Dynamic Title Adding Script
Script Title: Dynamic Title Adding Script
Description: This script lets a visitor change a piece of text on your page.
Example: Available
Using the W3C DOM, you can dynamically change the heading at the top of this page. Enter a new title and click the Change button.
Copy the following code into your <HEAD></HEAD> tags.<script language="Javascript"> function ChangeTitle() { var newtitle = document.form1.newtitle.value; var head1 = document.getElementById("head1"); head1.firstChild.nodeValue=newtitle; } </script>
Copy the following code between the <BODY></BODY> tags of your html page.<h1 ID="head1">Dynamic Text in JavaScript</h1> <p>Using the W3C DOM, you can dynamically change the heading at the top of this page. Enter a new title and click the Change button. <form name="form1"> <input type="text" name="newtitle" size="25"> <input type="button" value="Change!" onClick="ChangeTitle();"> </form>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email