Spaces:
Running
Running
File size: 1,442 Bytes
cc20e0e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Iframe Generator</title>
<style>
body {
font-family: Arial, sans-serif;
}
#iframe-container {
margin-top: 20px;
}
iframe {
width: 100%;
height: 500px;
margin-bottom: 10px;
border: 1px solid #ddd;
}
</style>
</head>
<body>
<h2>Iframe Generator</h2>
<input type="text" id="urlInput" placeholder="Enter URL">
<input type="number" id="countInput" placeholder="Number of iframes">
<button onclick="generateIframes()">Generate Iframes</button>
<div id="iframe-container"></div>
<script>
function generateIframes() {
const url = document.getElementById('urlInput').value;
const count = parseInt(document.getElementById('countInput').value);
const container = document.getElementById('iframe-container');
// Clear existing iframes
container.innerHTML = '';
if (url && count > 0) {
for (let i = 0; i < count; i++) {
const iframe = document.createElement('iframe');
iframe.src = url;
container.appendChild(iframe);
}
} else {
alert('Please enter a valid URL and iframe count.');
}
}
</script>
</body>
</html> |