2

I am trying to call a function on button click and it throws function name not defined. Where I am doing it wrong?

Here is my fiddle

function showit(){
var el = document.getElementById("testBox");
alert(el);
}

<input type=text id='testBox'>
<input type=button value='click' onclick='showit()'>
Kurkula
  • 6,386
  • 27
  • 127
  • 202

0 Answers0