+ 1
How do I limit the user's click on table cell ?
When I had to limit the clicks of a button I did it by making a variable counter and increasing it on every click ,when it reaches 4 js disables the button but here I have to disable a <td> which I am not able to do so can somebody help?
9 ответов
+ 13
document.getElementsByTagName("td")[0].style.pointerEvents="none";
//tip: Don't disable clicking, just prohibit writing....
+ 2
hide the table cell could be an idea?
+ 2
why should someone click on table cell?
+ 2
use a flag and set it to 1 to not execute the code
function assign(x) {
if(flag == 0) {
var y = ""
if(x == "1") {
y = "1"
clicklimit();
......
}
+ 1
still waiting for the answer 😐😐😐
+ 1
nope 😐
+ 1
he will here is my code
https://code.sololearn.com/WH1dAbhm8xzw/?ref=app
try clicking on the table cell
+ 1
actually here is the main code the previous one is designed for better ui (yeah the previous one doesn't function properly)
https://code.sololearn.com/W92xHw224bgd/?ref=app
+ 1
yeah disabling doesn't work for <td>