In C#.Net, We would use Conditional Statement like this below:
string Place = TextBox1.Text == "" ? "School" : TextBox1.Text;
How to use Conditional Statement in JavaScript. I am assigning one value to the TextBox, If there is no value then I want to assign "1" to the TextBox.
Here I used like this,
document.getElementById('<%=txtPlace.ClientID %>').value = obj[1];
If obj[1] == "" then I want to assign "1" to the TextBox. How to assign? It can be done easily by using If statement. But I want to know how to use Conditional Statement in JavaScript? Is there Conditional Statement in JavaScript? If so then how to use it?