Home > Web Front-end > JS Tutorial > JS method to dynamically modify iframe height and width_javascript skills

JS method to dynamically modify iframe height and width_javascript skills

WBOY
Release: 2016-05-16 16:06:27
Original
1693 people have browsed it

The example in this article describes the method of dynamically modifying the height and width of iframe with JS. Share it with everyone for your reference. The details are as follows:

If you want to dynamically modify the height and width of the iframe through buttons, you can refer to the following JS code

<!DOCTYPE html>
<html>
<head>
<script>
function changeSize()
{
document.getElementById("myframe").height="300";
document.getElementById("myframe").width="300";
}
</script>
</head>
<body>
<iframe id="myframe" src="/default.asp" 
height="200" width="200">
<p>Your browser does not support iframes.</p>
</iframe>
<br><br>
<input type="button" onclick="changeSize()" 
value="Change size">
</body>
</html>
Copy after login

I hope this article will be helpful to everyone’s JavaScript programming design.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template