0
I would like to know how to call more than one function with just a "Click".
window.onload = function(){
var btn = document.getElementById("resposta");
btn.addEventListener("click",function(){
var nomedoCliente = parseFloat(document.getElementById("nmCliente").value)
calcular(nomedoCliente);
},false);
function calcular(a){
var xNmCliente = document.getElementById("nmCliente").value
var xVidas = document.getElementById("vidas").value
var xMarca = document.getElementById("marca").value
var a = 0
var execucao
var coringa = 0
if (xVidas == "vidas1" && xMarca == "marca1" ) {
a=1
}
else if (xVidas == "vidas1" && xMarca == "marca2" ) {
a=1
}
else if (xVidas == "vidas2" && xMarca == "marca1" ) {
a=4
}
else if (xVidas == "vidas3" && xMarca == "marca1") {
a=3
}
else {
coringa=0
}
if(xMarca=="marca1" && a =="3"){
execucao = 34
}
else if (xMarca =="marca2" && a=="1"){
execucao = 88
}
else{
execucao == 0
}
}
}
<p>Quantas vidas temos?</p>
<select id = "vidas">
<option value="vidas1" >Menos 1000</option>
<option value="vidas2" >1000 a 5000</option>
<option value="vidas3" >Mais de 5000</option>
</select>
<p >O quanto nossa marca é importante para a Operadora?</p>
<select id = "marca">
<option value="marca1" >Pouco Importante</option>
<option value="marca2" >Importante</option>
<option value="marca3" >De relevância estratégica</option>
</select></br>
I’d like to get the result of a
, as in the other if
, to obtain the result of Execucao
.
It is possible to do everything in just one function?
That way I put it, nothing happens when I squeeze Resultado
. I’ve looked at other topics, but it’s not making much sense.
If the code that is here is the same as you have, then this missing element reply
– NoobSaibot