Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
the thing is that i am actually new to javascript so I don't really know much.

thanks in advance

What I have tried:

i tried looking online but couldn't find much, I hope the answers here will help
Posted
Updated 21-Jul-23 4:40am

Here's a JSFiddle with an example[^] of how you could accomplish it. You just need to register event listeners for click events, and you can compare the button to any other buttons found on the page.
 
Share this answer
 
We are more than willing to help out but we will not write your code for you. We expect to see you make at least a token effort.

Instead of "looking online" for solutions, learn the language - there are plenty of free resources available e.g. learn javascript online - Google Search[^]
Do some study, give it a try then come back if you are still struggling
 
Share this answer
 
Start with the JavaScript Tutorial[^].
 
Share this answer
 
Quote:
I want to make a function in javascript that allows all the other buttons to be disabled if a button is pressed

Is it what you are looking for ?
HTML input type="radio"[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900