alert text & variable JavaScript
36,769
Solution 1
alert('Your text goes here'+your var goes here);
I find out the code I should have put
Solution 2
var name = "John Doe";
function myFunction() {
alert('Hello ' + name);
}
<button onclick="myFunction()">Checkout</button>
Author by
Vadim Kotov
Updated on July 16, 2020Comments
-
Vadim Kotov almost 4 years
Can I put both text and variable in the same alert box I thought the code down would work but it didn't
alert('text'Variable);
-
Koby Douek about 7 yearsWhere is
Total
defined? Please share your full code. -
mplungjan about 7 yearsIt WOULD work if you had defined Total somewhere
-