full screen does not work with F11 on IE 11

I want my game to go full screen when the player press F11.

I noticed if the player has click on the canvas the game does not go to full screen with F11.
If he click the area outside the canvas the game does go to full screen when he press F11.

I captured F11 keypress in game and ran following script I found in web.
This works well for all the browsers except IE 11.

var docElm                 = document.getElementById('main');

if (docElm.requestFullscreen) {
    docElm.requestFullscreen();
}
else if (docElm.msRequestFullscreen) {
    docElm = document.body; 
    docElm.msRequestFullscreen();
}
else if (docElm.mozRequestFullScreen) {
    docElm.mozRequestFullScreen();
}
else if (docElm.webkitRequestFullScreen) {
    docElm.webkitRequestFullScreen();
}

“msRequestFullscreen” should work for IE, but it does not.
Is there a way to get the full screen working for IE ?