1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-20 01:46:15 -04:00
elinks/test/ecmascript/assert/element.textContent.html
2024-06-19 16:48:36 +02:00

31 lines
940 B
HTML

<!DOCTYPE html>
<html>
<body>
<h3>Differences between innerText and textContent.</h3>
<p id="demo">This p element contains a <span style="display:block">hidden span element</span> and a <span> visible span element</span>.</p>kkkk
<button onclick="getTextContent()">Get textContent</button>
<button onclick="getInnerText()">Get innerText</button>
<p><strong>Note:</strong> The textContent property is not supported in Internet Explorer 8 and earlier, and the innerText property is not supported in IE9 and earlier.</p>
<p id="demo"></p>
<script>
function getTextContent() {
console.assert(document.getElementById("demo").textContent === 'This p element contains a hidden span element and a visible span element.', 'without tags');
}
function getInnerText() {
window.alert(document.getElementById("demo").innerText)
}
console.error('element.textContent.html');
getTextContent();
console.exit();
</script>
</body>
</html>