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

163
Views
Button that functions conditionally depending on whether or not another button is clicked

I'm making a program with 4 players.

Each player having a main button to trigger a main function and 3 more buttons, each blocking one of the 3 remaining players from performing the main function while triggering the same main function for the player pushing the button

When the blocked player pushes their main button it triggers a different function than the main one.

I have been able to make the main button and its functionality but not the effects of the block button.

Currently I'm putting this in my external js script for the blocked function:

if (document.getElementById("kelly-block-john").clicked == true){
  document.getElementById("john-button").onclick = "johnBlocked()";
}

Does anybody have any idea on how to make the effects of the block buttons work?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Use Event Listener to check if the button is clicked and also to run a function when it is clicked. Find out the details and syntax here: https://www.w3schools.com/js/js_htmldom_eventlistener.asp

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