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 - view diff
Embed
Download Paste or View Raw
Hits: 122
  1. function gerar() {
  2.     let tab = window.document.getElementById('seltab')
  3.     let ini = window.document.getElementById('cxct1')
  4.     if (ini.value.length == 0) {
  5.         window.alert('Valor inválido')
  6.     } else {
  7.         let n = Number(ini.value)
  8.        
  9.         for (let c = 1; c <= 10; c++) {
  10.             let item = document.getElementById('res')
  11.             res.text = `${n} x ${c} = ${n*c}`
  12.             tab.appendChild(item)
  13.         }
  14.          
  15.     }
  16. }
  17.