Answer: We can check with 2 ways:-
var txt_emp_salary = document.getElementById("<%=txt_employee_salary.ClientID%>");
if(txt_emp_salary !=null)
{
//1st way
if(txt_emp_salary.value!= '')
{
alert('Textbox has a value');
}
//2nd way
if(txt_emp_salary.value.length>0)
{
alert('Textbox has a value');
}
}
Asked In: Many Interviews |
Alert Moderator