Question: JavaScript display variable in alert

Ads

 
 
 

Share on Google+Share on Google+

ratna rathor
JavaScript display variable in alert
1 Answer(s)      5 years 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 prompt alert
javascript prompt alert   Sending a prompt alert using a JavaScript function
Advertisements
Javascript alert message
Javascript alert message   How to send an alert message to a user in JavaScript
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
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
javascript variable value insertion in DB
javascript variable value insertion in DB  how can I insert javascript variable value into database using php
php variable in javascript
php variable in javascript  Access php variables in Javascipt or Jquery rather than php echo $variable
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
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> <
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
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 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 <
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
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 in jsp
alert in jsp  if(pass.equals(pwd)) { Statement st1..."); %> alert("password is successfully changed"); <... Password"); %> <script> alert("please enter old Password
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:<
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
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
JSP Alert
JSP Alert          JSP Alert is used to put the validation on login... the validation on the login form using Javascript method in JSP page.  Understand
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
Tutorials   
Java Spring Hibernate Struts Training code for programming How can I dynamically load user-entered data as content of jquery dialog? java webcam integration question java coding Fix Scrollbar position in a checkboxList after postback Information Save Alert Country wise redirection to files Interface in javascript connect database with javascript Zip Code ZipCode how to validate the email login How to play FLV video files on Ipad using HTML code or javascript code? Nitobi Grid is not working in IE10/IE11 jquery issue plese help RegEx Tree structure from json whose parents can be dragged and dropped from child newyorklife insurance getElementById not working javascript code for search in html file Implement The Skeleton Code Implement This Skeleton Code Mobile Automation using Appium Computer forensic application Java: Searching a string from doc files java linked list urgent !!! java linked list urgent!!! library management library management library management library management question Html form using JavaScript to display the table content java how to prevent no from unroundin off on clicking text box again in JSP and Jquery graph generation from xml design file display data from database in textbox when id entered in textbox Javascript Code for all fields how to get HTTP GET request value using javascript array Javascript Querry autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me Create SpreadSheet same as excel using java applet Create SpreadSheet same as excel using java applet How to change focus among multiple select boxes? Write JQUERY Code Write JQUERY Code Converting jsp variable to java variable java

Ads

 
Advertisement null

Ads