hercioneto

meuArquivo.js

Jun 19th, 2023
932
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var nome;
  2. nome = "Fulano de Tal";
  3. var idade = 30;
  4. conta = 30 + 20 - 10*5;
  5.  
  6. function exibirMensagem()
  7. {
  8.   alert("Olá "+ nome + ", seja bem vindo(a)!");
  9. }
  10.  
  11. function clicou() {
  12.       var nome;
  13.       nome = prompt("Qual é seu nome?");
  14.       alert("Olá, " + nome);
  15.  }
  16.  
  17. function pergunta(){
  18. var pergunta = confirm("Você está aprendendo?");
  19. if(pergunta == true) {
  20.  alert("Que bom!");
  21. } else {
  22.  alert("Opa...");
  23. }
  24.  
  25. }
  26.  
  27. function escrever(){
  28. document.writeln("<pre>");
  29.  document.writeln("Inserindo texto no documento com writeln().");
  30.  document.writeln("Linha 1.");
  31.  document.writeln("Linha 2.");
  32.  document.writeln("Linha 3.");
  33.  document.writeln("</pre>");
  34. }
  35.  
  36. function escrever2(){
  37. var elemento = document.getElementById("texto");
  38. var texto = document. createTextNode("Escrevendo na div");
  39. elemento. appendChild(texto);
  40.  
  41. document.getElementById("texto").style.color = "red";
  42.  document.getElementById("texto").style.backgroundColor = "green";
  43.  document.getElementById("texto").style.fontStyle = "italic";
  44.  
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment