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:

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

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

 </script>
</head>
Write below code at designing part of asp.net web forms.
<html>
<body>
<input type=”button” onclick=”show()” value=”If Statment” />
</body>
</html>
  • 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 *

4 + 2 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">