How to get the textbox value at the client side ?

Platform: ASP.NET| Category: TextBox

<script lang='javascript'> 
function CheckFunction() 
{ 
if (document.getElementById(’<%=textbox2.ClientID%>’).value == '') 
{ 
	alert('Please enter a value'); 
	return; 
} 
} 
</script> 



<asp:textbox id='textbox2' runat='Server'></asp:textbox> 
<input type=button id='btn1' onclick='javascript:CheckFunction();' value='Click'>

Share with