Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <tr id="boletinAluno">
  2.  
  3. </tr>
  4.  
  5. function cadastrarAluno(e){
  6.  
  7. let nome = document.querySelector('#nome').value
  8. let nota1 = document.querySelector('#nota1').value
  9. let nota2 = document.querySelector('#nota2').value
  10. let nota3 = document.querySelector('#nota3').value
  11.  
  12. let aluno = new Aluno(nome,nota1,nota2,nota3)
  13.  
  14. montarLinha(aluno);
  15.  
  16.  
  17.  
  18. }
  19.  
  20. function montarLinha(aluno){
  21. let content = `
  22. <td>${aluno.nome}</td>
  23. <td>${aluno.nota1}</td>
  24. <td>${aluno.nota2}</td>
  25. <td>${aluno.nota3}</td>
  26. <td>${aluno.getMedia}</td>
  27.  
  28. `
  29. boletin = document.querySelector('#boletinAluno').innerHTML+=content;
  30.  
  31.  
  32. }
  33.  
  34. index.html:89 Uncaught TypeError: Cannot read property 'innerHTML' of null
  35. at montarLinha (index.html:89)
  36. at cadastrarAluno (index.html:75)
  37. at HTMLInputElement.onclick (index.html:39)
  38. montarLinha @ index.html:89
  39. cadastrarAluno @ index.html:75
  40. onclick @ index.html:39
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement