Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #13422
| From | jbasemvd@gmail.com |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | getElementById assistance needed. |
| Date | 2012-04-17 07:43 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <12337143.309.1334673816427.JavaMail.geo-discussion-forums@ynhh34> (permalink) |
Can someone tell me why this doesn't copy the text from one input to the other when the second input box is clicked? Thanks in advance.
<!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" >
<head>
<title>Untitled Page</title>
<link rel="stylesheet" type="text/css" href="StyleSheet1.css" />
<script type="text/javascript">
function getValue()
{
var x=document.getElementById("txtHere");
var y=document.getElementById("txtThere");
y.innerHTML = x.innerHTML;
}
</script>
</head>
<body>
<table class="basicTable" id="table1">
<tr>
<td><label for=here>Here</label></td><td><label for=there>There</label></td>
</tr>
<tr>
<td><input class="normal" id="txtHere" type="text" /></td><td><input class="normal" id="txtThere" type="text" onclick="getValue()"/></td>
</tr>
<tr>
<td><input class="basicButton" id="submit" type="submit" value="Submit" /></td>
</tr>
</table>
</body>
</html>
Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread
getElementById assistance needed. jbasemvd@gmail.com - 2012-04-17 07:43 -0700
Re: getElementById assistance needed. Martin Honnen <mahotrash@yahoo.de> - 2012-04-17 16:58 +0200
Re: getElementById assistance needed. jbasemvd@gmail.com - 2012-04-17 08:08 -0700
csiph-web