How to remove scrollbar from iframe

Do you want to know how you can remove the scrollbar from an iframe?

In this article, you will learn how to remove the scrollbar from an iframe using css and also javascript.

Remove scrollbar from iframe using html attribute.

Add scrolling="no" attribute to the iframe to remove the scrollbar. the example is given below.

Example of scrolling attribute.
<iframe scrolling="no" width="300" height="200" src="https://search.3schools.in/p/example.html"></iframe>
Try it Yourself »

Remove scrollbar from iframe using JavaScript.

In this example, we will add the scrolling="no" attribute to the iframe using javascript.

Remove scroll bar from iframe using js
<iframe id="my-iframe" style="width:300px;height:200px;" src="https://search.3schools.in/p/example.html"></iframe>
<button onclick="myFunc()">Remove Scrolling</button>
<script>
function myFunc(){
  document.querySelector('#my-iframe').scrolling = "no";
}
</script>
Try it Yourself »