Assigning a variable, and printing the value in JavaScript
/*Assigning a variable, and printing the value in JavaScript*/
<html>
<head>
<title> Assigning a Variable </title>
<script language="javascript">
var a = 10;
function display()
{
document.write("a =" +a);
}
</script>
</head>
<body>
<script>
display();
</script>
</html>
Output:
a = 5