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

223
Visualizações
How to call JavaScript function from a .HTML file to a .JS file?

I've been working on a .js and .html file and in my .js file, I want to call to a function that's located in the .html file.

This is the function in the .html file that I want to be called to:

    <script>
        function themeChange4() {
            document.getElementById("theStyle").style = "";
        }
    </script>

This is where I want the function to be called to in my .js file:

add_icon_not_via_filesystem({
    title: "Vending Machine",
    icon: "Soda",
    open: themeChange4,
});
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If I understood You want from HTML

  <script src="js.js"></script>
  <script>
  function themeChange4(){
     add_icon_not_via_filesystem(); 
  }
themeChange4();
 </script>

to call

function add_icon_not_via_filesystem(){
 alert('This');
 }
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