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

246
Visualizações
How to lock content until user does a task?

I am currently developing a “course” platform, and I want to prevent the user from advancing to the next topic until they click the last item on the current topic.

In this first activity I want that the next button is disabled or something like that until the user downloads the file, so clicks on the download image.

I assume it will be with JavaScript by changing the value on the HTML item with a getElementByID or with an eventListener, but I am not clear on how to proceed.

I am not using input fields so I can't use disabled. I am using images inside of an tag as it shows here:

enter image description here

Do you guys know how can I do this?

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

0

<body>
<input type="button" id="button1" value="Task 1" 
onclick="unlockButton()" />
<input type="button" id="button2" value="Task 2" disabled />
<script>
    function unlockButton() {
        document.getElementById("button2").disabled = false;
    }
</script>
about 4 years ago · Juan Pablo Isaza Relatório

0

Yes, you can do this in multiple ways using javaScript. Here are some examples:
Disable/Non-Clickable an HTML button in Javascript


Simplest way I can think of:

<html>
<head>
    <script>
        function unlockButton() {
            document.getElementById("button2").disabled = false;
        }
    </script>
</head>

<body>
    <input type="button" id="button1" value="Task 1" onclick="unlockButton()" />
    <input type="button" id="button2" value="Task 2" disabled />
</body>

</html>
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