1
I am layman and am learning Javascript for a app simple hybrid. The first obstacle is a Function that is not running:
The one whose name:
function calcular(){
//ap1 = parseFloat(document.getElementById('ap1').value);
var media, final;
media = calculo.ap1.value.replace(",", ".");
media = parseFloat(media);
alert(media);
}
I referenced the file where it is in the index and made the call in a form:
<form action="javascript:calcular();" method="get"id="calculo" name="calculo" class="list">
Even so, it’s not running Function. I appreciate the help.
And what comes in
calculo.ap1.value
?– BrTkCa
It is the value of an imput within the form
– Mr.Malaka
Can you show us the value of it? Put a
console.log(calculo.ap1.value)
.– BrTkCa
Decided to take the action 'Function' and put in 'Onsubmit' .. Thanks friends!!
– Mr.Malaka