Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to display JavaScript variable value in alert box?
To display JavaScript variable value in an alert box, try to run the following code −
Example
<html>
<head>
<script>
function display() {
var a = "Simple";
var b = "Learning";
alert(a +" Easy "+ b);
}
</script>
</head>
<body>
<input type="button" value="Click me!" onClick="display();">
</body>
</html> Advertisements
