2
I need to do a "formatted" Alert, something like:
Price: variable X.
Product name: variable Y
Description: variable Z
But I can’t find in any documentation how to do such "formatting", I tried it as follows:
buttonBuy.addEventListener("click", () => {
alert("Comprar:" + name, "Preço" + preco,"Quantidade de Unidades" + quantidadeunidades.value,"Quantidade de Caixas" + quantidadecaixas.value);
});
Wasn’t it very clear what you really want? How so formatted?
– Taffarel Xavier
For example, appear the word Name, and dps of it the variable X, ai in the other row the word Price, and the variable Y.
– Vinicius
Ah! You want to concatenate strings.
– Taffarel Xavier
I believe that what it in case is to format a string.
– Ricardo Andrade
If so please update the question. have a well formulated question helps other people who have the same problem.
– Ricardo Andrade