+ 1

How do i get an onclick event to work on an Android tablet

I am trying to get an onclick event to work but on a tablet in sololearn does not work.

3rd Sep 2020, 10:33 AM
Graeme Adamson
7 odpowiedzi
+ 9
Show your code so that we can help
3rd Sep 2020, 10:35 AM
Harsh
Harsh - avatar
+ 9
To make button work you have to define function Ex- <button onclick="hello()">click me</button> <script> function hello(){ alert("please define function") } </script>
3rd Sep 2020, 10:53 AM
Harsh
Harsh - avatar
+ 2
Hi Graeme Adamson, you forgot to put parenthesis there, in the button tag attribute, instead of "prsbtn1", you need to use "prsbtn1() "
3rd Sep 2020, 7:11 PM
Hitesh Datt
Hitesh Datt - avatar
3rd Sep 2020, 10:40 AM
Graeme Adamson
+ 1
Thanks got it sorted. I will try to be more careful.
8th Sep 2020, 10:26 AM
Graeme Adamson
+ 1
Got it sorted it a beginners error. Thanks
8th Sep 2020, 10:30 AM
Graeme Adamson