js code bug under Firefox

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Post Reply
alexlead
Posts: 1
Joined: October 18th, 2016, 5:39 am

js code bug under Firefox

Post by alexlead »

Hello All!

I have problem with JS game. When I block start button by code: document.getElementById('startButton').disabled = true; - firefox block keyboard inputs. (www.runwave.ru/snake/) The problem is under Firefox only (IE, Opera, Chrome work without problem). If I commented the code, keypad works under Firefox too. But there are some other problems.

If I block other button it is not help to solve the problem.
User avatar
DanRaisch
Moderator
Posts: 127166
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: js code bug under Firefox

Post by DanRaisch »

Moving to Web Development.
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: js code bug under Firefox

Post by Frenzie »

First remove (blur) the focus.

Code: Select all

var startButton = document.getElementById('startButton');
startButton.blur();
startButton.setAttribute('disabled','disabled');
document.getElementById('newGameButton').setAttribute('disabled','disabled');
Intelligent alien life does exist, otherwise they would have contacted us.
Post Reply