HTML Element: <h1>
[this page | pdf | back links]
The HTML <h1> element indicates a level 1
HTML heading.
The attributes
it can take are HTML
global attributes and HTML event attributes.
It
used to support the align
attribute, but this is no longer supported in HTML 5.
To
create or access such an element in JavaScript
see here. The
corresponding HTML DOM
object supports standard
DOM properties and methods. The default style applicable to this element is
shown here.
EXAMPLE:
HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head></head>
<body>
Created using HTML:<br>
<h1>Heading 1</h1>
<br><br>Created using JavaScript:<br>
<span id="element"></span>
<script>
var y = document.getElementById("element");
var x1 = document.createElement("H1");
x1.textContent = "Heading 1";
y.appendChild(x1);
</script>
</body>
</html>
|
NAVIGATION LINKS
Contents | Prev | Next | HTML Elements