Home › Forums › JavaScript › jQuery .on('click') not working on some mobile browsers › Reply To: jQuery .on('click') not working on some mobile browsers
December 16, 2015 at 6:19 pm
#235929
koenigsegg1
Participant
I added this code:
$(".btn").on('mousedown touchstart', function(){
alert("The btn was clicked.");
});
… and it triggered an alert. I’m not shure why it can’t do a basic .removeClass
.
How do you usually add/remove classes by clicking an element on mobile devices? Am I doing something wrong? Like I said, I’m very new to JS, so I don’t understand a lot of things.