+ 1
I want to select one option and disable rest options. I am not able to do that. Can anybody help me with this??
10 Respuestas
+ 1
Jagmeet Singh A skeleton demo:
https://code.sololearn.com/WrWM5SfH7FfH/?ref=app
+ 3
Sebastian Pacurar It could just be that he's fairly new to this and hadn't realised there was another way. His profile suggests he's only been learning for a month or so, so I think we should cover all options when trying to help 😉
+ 2
to disable click event over any element you can use pointer-events property in your css file. like this:
.disabled-class {
pointer-events: none;
}
make sure the elements which don't match the right answer to have that class (disabled-class)
+ 2
I'm not sure I understand your question fully, but are you aware of the element attribute "disabled"? To disable a button (for example), you can do "button.disabled = true;".
+ 2
Russ i was thinking about the same thing but he used divs instead of buttons
+ 2
Russ i totally agree 👍😀
+ 1
Thank you Russ for explaining me with an example👍 i will implement it in my practice JavaScript program
+ 1
No worries, good luck and happy coding!
+ 1
Thank you Sebastian Pacurar for giving an idea to implement pointer-event in css
+ 1
Yes Russ well said, i want to change my domain and totally wants to get involve in web development. Hence just started learning a month back. Thanks for your support.