setTimeout not working πŸ€” | Sololearn: Learn to code for FREE!


setTimeout not working πŸ€”

Please help me to solve this error πŸ™‚ And why it's play when I touch on screen within 2 seconds

11 Answers

New Answer


I think Browsers has stopped supporting the play of audios after page loads without interacting with the page and can only be initiated when it has registered a gesture 🀷🏻.


for security reasons auto playing audios will not work on SOLOLEARN. It will only work if the user start the audio by his own hands. But if you still want to autoplay then you should trick the user. For example, trick the user so that he/she will force to touch the screen, from there you can start the audio like create an ad popup, a custom alert Box, or just by simply touching the screen one time. This way you can force them to start the audio. πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡ read this about blocking of auto play audio



setTinmeout is working but on sololearn audio file can not be played without user gesture that's why you face an error


I think it is Sololearn, I tried pasting the code into W3schools tryIt editor and it worked fine


Check the code


Hmm only here on sololearn you cant do this. I tried this many times but here it is not supported due to some reason. this is because of older version of browser engion used by sololearn.


Cheque your browser version πŸŒπŸŒŽπŸŒα΄€Ιͺᴍ🌍🌎🌏 It's working for me


丹ⓨㄩک廾 not working in Chrome and opera πŸ€”


γ…€Mr. Nβ™‘ β™‘Nβ‚¬β˜† γ…€γ…€ music not working πŸ™


I think you need write js code to "js"(you write js to html)