HTML Iframe Javascript
HTML Iframe Javascript
Iframes
HTML Iframes
An HTML iframe is used to display a web page within a
web page.
Tip: It is a good practice to always include a title attribute for the <iframe>. This is used by screen readers to read out what the content of the iframe is.
Iframe - Set Height and Width
• Use the height and width attributes to specify the size of the iframe.
• To remove the border, add the style attribute and use the CSS border
property:
With CSS, you can also change the size, style and color of the iframe's border:
Iframe - Target for a Link
• An iframe can be used as the target frame for a link.
• The target attribute of the link must refer to the name attribute of the
iframe:
HTML JavaScript
HTML JavaScript
• JavaScript makes HTML pages more dynamic and interactive.
• Example
JavaScript can change content:
JavaScript can change styles:
JavaScript can change attributes: