21 lines
677 B
HTML
21 lines
677 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Iframe Test</title>
|
|
</head>
|
|
<body>
|
|
<h1>Main Page</h1>
|
|
<p>This is the main page content.</p>
|
|
|
|
<iframe id="test-iframe" src="data:text/html,<html><body><h2>Iframe Content</h2><button id='iframe-button'>Click Me</button><script>document.getElementById('iframe-button').onclick = function() { alert('Iframe button clicked!'); }</script></body></html>" width="400" height="200"></iframe>
|
|
|
|
<button id="main-button">Main Page Button</button>
|
|
|
|
<script>
|
|
document.getElementById('main-button').onclick = function() {
|
|
alert('Main page button clicked!');
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|