'IFrame scrolling attribute set from onload event working differently on IE11 and edge/chrome

I am setting attribute "scrolling" from onload event and it is working differently in IE11 and Edge

<head>
<script>
function myFunction() {
  document.getElementById("myFrame").scrolling = "no";  
}
</script>
</head>
<body onload="myFunction()">
<iframe id="myFrame" src="http://example.com/"></iframe>
</body>

This stops scrolling in Edge but not in IE11, when I open this on edge of IE emulation mode, there also scrolling is happening. Strangely other attributes like height and width work fine in both edge and IE11. What could be the problem here?



Solution 1:[1]

As far as I know, the attribute scrolling is aleady deprecated, if you have to use this attribute in iframe, you can add it in html code manually instead of adding it dynamically through javascript.

Something like this:

<iframe id="myFrame" src="http://example.com/" scrolling="no"></iframe>

In addition, IE will end support soon. So I recommend that you focus more on modern browsers such as Microsoft Edge, Chrome instead of IE.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Xudong Peng