We can assign
####Showing the Code for the AssignValToMulVariable.html file#####
<!doctype html>
<html>
<head>
<title>Assigning values to multiple Variables</title>
</head>
<body>
<h1>Using Multiple Variable in the Script</h1>
<SCRIPT type="text/javascript">
var countBooks=50, minBookPrice=150, maxBookPrice=3000, bookName;
countBooks=2000;
minBookPrice=500;
maxBookPrice=minBookPrice;
document.write("countBooks="+countBooks+"<br/>");
document.write("maxBookPrice="+maxBookPrice+"<br/>");
document.write("bookName="+bookName);
</SCRIPT>
</body>
</html>
Here The variables countBooks, minBookPrice, maxBookPrice, and bookName are declared in the same statement .
####shows The OutPut of the AssignValToMulVariable.html file####
No comments:
Post a Comment