แท็ก HTML <iframe> ใช้สร้าง inline frame
ตัวอย่าง
<!DOCTYPE html>
<html>
<head>
<title>HTML iframe Tag</title>
</head>
<body>
<iframe src="https://www.tutorialspoint.com/index.htm" width="100%"></iframe>
</body>
</html>
แอตทริบิวต์ srcdoc ระบุเนื้อหา HTML ของหน้าที่จะแสดงใน iframe
ทางเลือกแทน srcdoc attribute:
var doc = document.querySelector('#demo').contentWindow.document;
var content = '<html></html>';
doc.open('text/html', 'replace');
doc.write(content);
doc.close();