0
Why can't I use the "onclick" html attribute on my phone
Why can't I use the "onclick" html attribute on my phone
4 Answers
+ 4
You have syntax error, because you try to nest two strings. The onclick attribute has a string value, and the alert function also has a string value.
You can fix it by changing one set of quotation marks to apostrophe (single quote) instead.
alert('Do you want to play?');
+ 4
You can use onclick anywhere. It is not device specific. Maybe the problem is with the rest of your code, which you did not attach.
+ 2
Ok here is code. https://code.sololearn.com/WtD8il49Ve5h/?ref=app
can you please check if there is any problem with it
+ 2
Okay I have done it. Thanks alot