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

107
Visualizações
Changing the function assinged to an event of a HTML form field by javascript

I am pretty new in Javascript, so I apologize if my question looks insane. Imagine that I added an eventListener to an input field:

<input type="password" name="password" id="password"  onkeyup="func1()">

Where func1 has been defined in a source file called js_funcs.js and added as

<script type="text/javascript" src="js_funcs.js"></script>

My questions are:

Can a user define a new function func2 in the browser console and assign it to onkeyup attribute of the password field to remove the limitations imposed by func1?

if yes: how to prevent it?

How if I add it using arrow function js_funcs.js file as the following in:

const password=document.getElementById('password');
password.addEventListener('keyup', ()=>{
// doing something.
})

Everything is checked in the backend to prevent any attack, but I want to know if it is possible to remove the limitation imposed by javascript in the frontend and how to prevent it.

about 4 years ago · Juan Pablo Isaza
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