Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

166
Visualizações
the images aren't displaying when pressing the button
  <head>   
    <script type="javascript/css">
      var die1Image,die2Image,die3Image,die4Image;
      function start(){
        var button=document.getElementById("rollButton");
        button.addEventListener("click",rollDice,false);
        die1Image=document.getElementById("die1");
        die2Image=document.getElementById("die2");
        die3Image=document.getElementById("die3");
        die4Image=document.getElementById("die4");
      }
      function rollDice(){
        setImage(die1Image);
        setImage(die2Image);
        setImage(die3Image);
        setImage(die4Image);
      }
      function setImage(dieImg){
        var dieValue=Math.floor(1+Math.random()*6);
        dieImg.setAttribute("src","die"+dieValue+".png");
        dieImg.setAttribute("alt","die image with "+dieValue+" spot(s)");
      }
      window.addEventListener("load",start,false);
    </script>
</head>
  <body>
    <form action="#">
      <input id="rollButton" type="button" value="Roll Dice">
    </form>
    <ol>
      <li><img id="die1" src="blank.png" alt="die 1 image"></li>
      <li><img id="die2" src="blank.png" alt="die 2 image"></li>
      <li><img id="die3" src="blank.png" alt="die 3 image"></li>
      <li><img id="die4" src="blank.png" alt="die 4 image"></li>
    </ol>
  </body>

whenever I click the roll button, the blank.png photos stay and die photos don't display in their places. the die images are named (die1.png->die6.png) correctly.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

<script type="text/javascript"> and not "javascript/css"

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda