I have the following html:
<input type="text" id="theInput" />
<input id="clickMe" type="button" value="Search" onclick="testFunction(document.getElementById('theInput').value)" /><br>
I am trying to trigger this:
function testFunction(data)
{
alert(data);
}
I also tried an alternative, using:
document.getElementById("clickMe").onclick = testFunction(document.getElementById("theInput").value);
Sadly, neither of these methods seem to get the function to trigger. I'm sure I am missing something simple, could anyone point it out, please?