IF Statement in JavaScript

Here in this asp.net example we will learn java script if statement in javascript exmaple we will leran java script function on button click event.

Here we tack an example of IF statement of Javascript.
Javascript code will be written in <Head> section of HTML page.

write the below javascript code at head section on web form:

<script type=”text/javascript”>
function show()
var mm = new Date();
var hour = mm.getHours();

if (hour < 12)
alert (“Good morning”);
alert (“Very Good Afternoon”);

Write below code at designing part of asp.net web forms.
<input type=”button” onclick=”show()” value=”If Statment” />
  • Example of IF Statement in JavaScript with ASP.Net
 how to learn java script if statement in asp.net
javascript if statement
I hope this javascript if statement example will help you….

Leave a Reply

Your email address will not be published. Required fields are marked *