i need to alert entered textbox value so i am doing it as follow.
Html code:
<input type="text" id="textbox1" class="cal" />
JQuery code:
$(document).ready(function () {
var get = $("#textbox").val();
$("#calculate").click(function () {
alert(get);
});
});
At click,it always says undefined.Why?
Thanks.
Your id is
textbox1, and you should get the value when clicked, or you just get the initial value.