Howdy all...
Here's a [very] stripped down version of a function I'm trying to create... just enough to get the gist of my problem.
Simply put, if you pass the letter "a" into the textbox and click Execute, I want the alert to pop "Alpha". If b is passed into the function, I want the alert to pop "Beta", etc... I know I'm missing something in the red area (below)... but can't for the life of me figure out what...
Code:<input type="text" id="letter" size="10"> <input type="button" id="button1" value="execute" onclick="displayit(document.getElementById('letter').value)">Any help would be greatly appreciated.Code:<SCRIPT language=javascript> function displayit(letter) { var targeta,targetb,targetc,showthis targeta="Alpha" targetb="Beta" targetc="Gamma" showthis='target'+letter { alert(showthis); } } </SCRIPT>
Thanks,
- I



Reply With Quote

Bookmarks