JavaScript display variable in alert

Ads

 
 

Share on Google+Share on Google+

ratna rathor
JavaScript display variable in alert
1 Answer(s)      5 years and 5 months ago
Posted in : JavaScript Questions

How to display variable in alert box? I am using javascript.

Ads
View Answers

May 16, 2012 at 4:31 PM


<html>
<head>
<script type="text/javascript">
function showAlert() {
    var name = "Roseindia";
    var city = "Delhi";
    alert(name +" is in "+ city);
}
</script>
</head>
<body>
<input type="button" value="Click for Alert" onClick="showAlert();">
</body>
</html>

Description: In JavaScript variable is declared by using var keyword.This variable can hold any type of value as int,string,float etc.alert() is used to generate alert. You can put variable or any statement in alert which you want to display.


Ads









Related Tutorials/Questions & Answers:
JavaScript display variable in alert
JavaScript display variable in alert  How to display variable in alert box? I am using javascript.   <html> <head> <script... put variable or any statement in alert which you want to display
Javascript alert message
Javascript alert message   How to send an alert message to a user in JavaScript
Advertisements
javascript prompt alert
javascript prompt alert   Sending a prompt alert using a JavaScript function
javascript statement alert
javascript statement alert  JavaScript Alert If Statement   JavaScript Alert if Statement <script type="text/javascript"> <...;/script> JavaScript Alert else if Statement <script type="text/javascript
JavaScript Alert YES NO
JavaScript Alert YES NO  How to send an alert to a user to confirm if there request is valid or not? I wants to send the alert message in Java Script... type="text/javascript"> function show_alert(my_string) { alert(my_string
JSP Variable in Javascript
JSP Variable in Javascript          JSP Variable in Javascript helps you to pass jsp variable to javascript. The JavaScript include a function
how to assign javascript variable value to a jsp variable
how to assign javascript variable value to a jsp variable  how to assign javascript variable value to a jsp variable
javascript variable value insertion in DB
javascript variable value insertion in DB  how can I insert javascript variable value into database using php
Passing a java property to a javascript variable
/javascript"); %> var collegename = ''; Java Script code: alert("collegename...Passing a java property to a javascript variable  i want to assign a java property to a js variable: action class: collegename have a property
php variable in javascript
php variable in javascript  Access php variables in Javascipt or Jquery rather than php echo $variable
Name Display in alert box - JSP-Servlet
Name Display in alert box  Dear Sir, Please any one help me......... when i enter some value in text that value is already in database display the alert box but the value is not in data base alert box is not display
how to call the array variable in scriptlet from javascript function
how to call the array variable in scriptlet from javascript function  ...","Porsche","Jaguar"}; %> Actually i want the array variable one by one and display them in the dropdown list by using the below function function myFunction
Getting Json data from servlet to javascript variable
Getting Json data from servlet to javascript variable  How do i get json data from my servlet on to a variable in javascript n bind the data to display onto sigma grid.Has anyone Idea how to do
How to pass javascript variable in Scriplet of JSP?
How to pass javascript variable in Scriplet of JSP?  How can I assign the value of a javascript variable to a variable declared in jsp scriplet? Is it possible
. Display JavaScript dropdown selected value
. Display JavaScript dropdown selected value  How to get the selected value from dropdown box? I am using javascript.   <html> <... you select any value from list, alert will display that. In var
Display two alert box alternately by clicking on text
Display two alert box alternately by clicking on text In this tutorial , we will discuss about how to display two alert box alternately by clicking on text... on it ,it will show a alert box. But when we click on it again , it shows second alert box
How to Display an alert message when nothing is selected in jspinner in java?
How to Display an alert message when nothing is selected in jspinner in java?  Hello, i'm trying to code a jspinner in java and i want to display... with the initial value = 0 what i want is if the user did not select the jspinner an alert
alert
alert  after pressing ok button in alert message it has to stop...; if(username==""){ alert("Enter Username!"); return false; } if(password==""){ alert("Enter Password!"); return false; } return true; } </script> <
convert javascript var to java variable - JSP-Servlet
convert javascript var to java variable  hi how to conver javascript var to java variable?  Hi Friend, We are providing you two ways: 1)a.jsp: function call(){ var name = "roseindia
Display alert box on clicking link
. We have used the JavaScript alert() function to display the message. Here...Display alert box on clicking link In this tutorial, we will display alert box... to display alert box in jQuery on link click?”: Mylink.html <
JavaScript Variables
JavaScript Variables: Variables are like containers, which contains a value. In JavaScript variables dependent on the value, not on the datatype that means variables are of  dynamic typing. Variable names are case-sensitive
Html form using JavaScript to display the table content
Html form using JavaScript to display the table content  HI There, Greetings, I am new to this java and I need your assistance. I have created... want to write a Html JavaScript coding to display the content from database
unable to get value returned from javascript variable in page
unable to get value returned from javascript variable in page  Hi, I... and store it in a variable so that i can use it in my servlet to validate an if else... the value of the radio button from fisrt page to be stored in a variable so
Java Alert Box
JOptionPane class to display the message alert box.  JOptionPane class is available...Java Alert Box In this example we will describe java alert box. First of all we have created class than main method after that we have created alert box
alert for validation
alert for validation  i want to put alert on the text box that enter data should be in DD/MM/YYYY format only through javascript validation.    <html> <script type='text/javascript'> var
Alert Box in Flex
Flex Alert Box Components Adobe Flex provides many types of components, in this tutorial we will study visual component. 1. Alert Box: In the present tutorial we will see how to display simple text using Alert Box. An Alert Box
javascript
javascript  write a program to display implement about browsers using javascript
jQuery alert()
box can display information. This example displays an alert box after clicking...jQuery alert() In this jQuery tutorial we will discuss how an alert box works in jQuery. Moreover, this tutorial will discuss in details about alert box
alert in jsp
alert in jsp  if(pass.equals(pwd)) { Statement st1..."); %> alert("password is successfully changed"); <... Password"); %> <script> alert("please enter old Password
jQuery Hello World alert
display "Hello World" alert box using jQuery. This application will use the JavaScript alert() method to display the "Hello World" message... braces{}. In the curly braces we have defined the JavaScript alert() method
Alert in Servlet
Alert in Servlet  <p>Hi</p> <p>I want to delete record from oracle db, i need alert message saying 'Are you sure you want... of each row, when i click delete it shd alert me....This is my servlet code:<