Hello I got this code but when I preview it shows me two error messages.
- There was an error in your script
- The element selector function (usually $w) cannot be used before the page is ready
var notaA=$w(‘#input5’).value
var nota1A=parseInt(notaA, 10)
var notaB=$w(‘#input6’).value
var nota1B=parseInt(notaB, 10)
var notaC=$w(‘#input7’).value
var nota1C=parseInt(notaC, 10)
var notaD=$w(‘#input12’).value
var nota1D=parseInt(notaD, 10)
var notaE=$w(‘#input15’).value
var nota1E=parseInt(notaE, 10)
var notaF=$w(‘#input18’).value
var nota1F=parseInt(notaF, 10)
var notaH=$w(‘#input21’).value
var nota1H=parseInt(notaH, 10)
var promedio
var credA=$w(‘#input5’).value
var cred1A=parseInt(credA, 10)
var credB=$w(‘#input6’).value
var cred1B=parseInt(credB, 10)
var credC=$w(‘#input7’).value
var cred1C=parseInt(credC, 10)
var credD=$w(‘#input12’).value
var cred1D=parseInt(credD, 10)
var credE=$w(‘#input15’).value
var cred1E=parseInt(credE, 10)
var credF=$w(‘#input18’).value
var cred1F=parseInt(credF, 10)
let credH=$w(‘#input21’).value
let cred1H=parseInt(credH, 10)
promedio=(nota1Acred1A+nota1Bcred1B+nota1Ccred1C+nota1Dcred1D+nota1Ecred1E+nota1Fcred1F+nota1H*cred1H)/(cred1A+cred1B+cred1C+cred1D+cred1E+cred1F+cred1H)
let prom=promedio.toString(10)
export function button2_click(event) {
//Add your code for this event here:
$w(‘#text12’).text=prom
}