Try this on for size then:
Code:
<script language="javascript">
<!--
function getinfo(input,output) {
document.getElementById(output).value = input;
}
-->
</script>
Code:
<input type="button" value="Massachusetts" onclick="getinfo('Cranberries for the win!','stdout')">
<input type="button" value="Ohio" onclick="getinfo('Got potatoes?','stdout')">
<input type="button" value="Californa" onclick="getinfo('Pure gold.','stdout')">
<br>
<input type="textbox" id="stdout">
Or together:
Code:
<html>
<head>
<title>Testing</title>
<script language="javascript">
<!--
function getinfo(input,output) { document.getElementById(output).value = input; }
-->
</script>
</head>
<body>
<input type="button" value="Massachusetts" onclick="getinfo('Cranberries for the win!','stdout')">
<input type="button" value="Ohio" onclick="getinfo('Got potatoes?','stdout')">
<input type="button" value="Californa" onclick="getinfo('Pure gold.','stdout')">
<br>
<!--uncomment this and comment or delete the <textarea> to output into a text box<input type="textbox" id="stdout">-->
<textarea id="stdout"></textarea>
</body>
</html>
If you want to learn some javascript, try http:/www.htmlgoodies.com/beyond/javascript
This was just a very simple thing, you can also use buttons to be outputted to, but it would pretty much useless. If you wanted to, you could change the script line to document.getElementById(output).innerHTML = input; and the output could be something like a <td> or <div> and you can then use HTML inside of the text.
Bookmarks