JSFiddle - React, Tailwind, and code Playground
by velo_ninja
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple HTML Page with iFrame</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is a simple HTML page.</p>
<!-- Button to trigger the iframe creation -->
<button onclick="createIframe()">Create iFrame</button>
<script>
function createIframe() {
// Create an iframe element
var iframe = document.createElement('iframe');
// Set attributes for the iframe
iframe.src = 'https://www.example.com'; // Replace with your desired URL
iframe.width = '600';
iframe.height = '400';
iframe.title = 'Example iFrame';
// Append the iframe to the body or any other desired element
document.body.appendChild(iframe);
}
</script>
</body>
</html>