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);
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);
Share
Improve this question
edited Jul 16, 2019 at 7:44
Vadim Kotov
8,2848 gold badges50 silver badges63 bronze badges
asked Mar 22, 2017 at 9:35
user7745990user7745990
2
-
Where is
Total
defined? Please share your full code. – Koby Douek Commented Mar 22, 2017 at 9:36 - 1 It WOULD work if you had defined Total somewhere – mplungjan Commented Mar 22, 2017 at 9:36
2 Answers
Reset to default 8
var name = "John Doe";
function myFunction() {
alert('Hello ' + name);
}
<button onclick="myFunction()">Checkout</button>
alert('Your text goes here'+your var goes here);
I find out the code I should have put