SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: DHTML Test
Hybrid View
-
Jul 4, 2007, 19:06 #1
- Join Date
- May 2005
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
DHTML Test
I was wondering why this doesn't work.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title>Test</title>
<script type="text/javascript">
function tester() {
var temp = document.getElementById('myp');
temp.nodeValue = "success";
}
</script>
</head>
<body>
<p id="myp">fail</p>
<input type="submit" name="Submit" value="Submit" onclick="tester(); return false;" />
</body>
</html>
-
Jul 4, 2007, 19:22 #2
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
temp.firstChild.data = "success";
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Jul 4, 2007, 22:46 #3
- Join Date
- May 2005
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Your a genius! thank you!
Sitepoints DHTML Utopia book claimed i had to use nodeValue.... I'm very disappointed in the book now.
-
Jul 4, 2007, 23:13 #4
Bookmarks