<p id="akapit1" class="grupa1" style="color:blue">To jest przykładowy akapit.</p>
To jest przykładowy akapit.
<script>
var element = document.getElementById("akapit1");
document.write("<pre>");
document.write("element = " + element + "\n");
document.write("Object.getPrototypeOf(element) = " + Object.getPrototypeOf(element) + "\n");
document.write("</pre>");
</script>
https://developer.mozilla.org/en-US/docs/Web/API/HTMLParagraphElement
<script>
document.write("<pre>");
document.write("element instanceof EventTarget = " + (element instanceof EventTarget) + "\n");
document.write("element instanceof Node = " + (element instanceof Node) + "\n");
document.write("element instanceof Element = " + (element instanceof Element) + "\n");
document.write("element instanceof HTMLElement = " + (element instanceof HTMLElement) + "\n");
document.write("element instanceof HTMLParagraphElement = " + (element instanceof HTMLParagraphElement));
document.write("</pre>");
</script>
https://developer.mozilla.org/en-US/docs/Web/API/Element
<script>
document.write("<pre>");
document.write("element.tagName = " + element.tagName + "\n");
document.write("element.id = " + element.id + "\n");
document.write("element.className = " + element.className + "\n");
document.write("element.style = " + element.style);
document.write("</pre>");
</script>
<script>
document.write("<pre>");
document.write("element.innerHTML = " + element.innerHTML + "\n");
document.write("element.outerHTML.replace(/</g, '<').replace(/>/g, '>')\n");
document.write("=\n");
document.write(element.outerHTML.replace(/</g, '<').replace(/>/g, '>'));
document.write("</pre>");
</script>
<script>
document.write("<pre>");
document.write("element.attributes = " + element.attributes + "\n");
document.write("element.attributes.length = " + element.attributes.length + "\n\n");
document.write("element.attributes[0] = " + element.attributes[0] + "\n");
document.write("element.attributes[1] = " + element.attributes[1] + "\n");
document.write("element.attributes[2] = " + element.attributes[2]);
document.write("</pre>");
</script>
<script>
var attribute = element.attributes;
var text = "";
for (var i = 0; i < attribute.length; i++)
{
text += attribute[i].name + " = " + attribute[i].value + "\n";
}
document.write("<pre>" + text + "</pre>");
</script>
<script>
document.write("<pre>");
document.write("element.getAttributeNames() = " + element.getAttributeNames() + "\n");
document.write("element.getAttribute('id') = " + element.getAttribute('id') + "\n");
document.write("element.getAttribute('class') = " + element.getAttribute('class') + "\n");
document.write("element.getAttribute('style') = " + element.getAttribute('style'));
document.write("</pre>");
</script>
<script>
var attribute = element.getAttributeNames();
var text = "";
for (var i = 0; i < attribute.length; i++)
{
text += attribute[i] + " = " + element.getAttribute(attribute[i]) + "\n";
}
document.write("<pre>" + text + "</pre>");
</script>