$(".rows .cell").click(function(e) { e.preventDefault(); if($(this).parent().hasClass("row-"+ result_2)) { var random = Math.floor(Math.random()*10); app.pickMiner(id); mine_button = $(this); } console.log("CELL CLICK"); }) 

Everything works, it changes, but sometimes it changes only when the element is clicked twice. Not so twice as with double click, but just the first time it does not work. Clicked - nothing happens. To open the item, you need to click again.

  • create a snippet to see what you have there - ddeadlink

1 answer 1

After

 e.preventDefault(); 

add

 e.stopPropagation(); 
  • 2
    and that will be? (585 characters left) - Igor
  • try it - take a look. - A. Piks