Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

106
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!