Facebook
From Rafael Dias dos Santos, 3 Years ago, written in JavaScript.
This paste is a reply to Código font Javascript from Rafael Dias dos Santos - go back
Embed
Viewing differences between Código font Javascript and Código font Javascript
function gerar() {
    let tab = window.document.getElementById('seltab')
    let ini = window.document.getElementById('cxct1')
    if (ini.value.length == 0) {
        window.alert('Valor inválido')
    } else {
        let n = Number(ini.value)
        
        for (let c = 1; c <= 10; c++) {
            let item = document.getElementById('res')
            res.text = `${n} x ${c} = ${n*c}`
            tab.appendChild(item)
        }
          
    }}
}