increment and decrement operator using javascript

Jitendrasoft09
Posted by Jitendrasoft09 under ASP.NET category on | Points: 40 | Views : 1921
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script language="javascript" type="text/javascript">
function myfunction()
{
var Num1 = 10;
var Num2 = 20;
var Num3 = --Num1
var Num4 = ++Num2;
alert("Prefix decrement value=" + Num3);
alert("Prefix increment value=" + Num4);

}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Button ID="Button1" runat="server" Text="Button"
OnClientClick="return myfunction()" onclick="Button1_Click1" />

</div>
</form>
</body>
</html>

Comments or Responses

Login to post response