faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

23 of 33 people (70%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How do I change the field value of a HTML text element in IE 5 + AND NN 6 using getElementById ?

Apr 5th, 2008 20:32
ha mo, sven vahar, Gudrun,


<html>
<head>
	<title> * </title>
	<script language="JavaScript" type="text/javascript">
	<!--
	function change (){
		var x = document.getElementById('nr56');
		x.value = "... but she ate it for Xmas";
	};
	// -->
	</script>
</head>
<body>
<form>
	<input type="text" id="nr56" size="40" value="Mary had a little lamb"><br
/><br />
	<button type="button" onclick="change()">change it</button>
</form>
</body>
</html>
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com