This program prints all words in the textarea if there is ed. I need to print all words in the textarea that end with ed.
<html>
<head>
<title></title>
<script type = "text/javascript">
function testString()
{
var myForm = document.getElementById( "myForm" );
var s = myForm.input.value;
if ( s.substr( s.length - 2, 2 ) == "ed" )
myForm.output.value += s + "\n";
}
</script>
</head>
<body>
<form id = "myForm" >
<textarea name = "input" rows = "10" cols = "55"></textarea><br />
<input type = "button" value = "Submit" onclick = "testString()" /><br />
<textarea name = "output" rows = "10" cols = "55"></textarea>
</form>
</body>
</html>