Hello I am new to Jquery i am using pure javascript till now.Now i am trying jquery .
HTML
<input id="scriptBox" type="text" onkeypress="return test(event)" />
Javascript
function test(e) {
if (e.keyCode == 13) {
var tb = document.getElementById("scriptBox");
eval(tb.value);
return false;
}
}
How to do this in jquery.
Beware of using
eval, but here’s how to write your code in jQuery: