Created
April 7, 2020 05:23
-
-
Save mehrad-dm/f040fef599ba6eabbb177845dfe425dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Critical Path: Measure Inlined</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<style> | |
p { font-weight: bold } | |
span { color: red } | |
p span { display: none } | |
img { float: right } | |
</style> | |
</head> | |
<body> | |
<p>Hello <span>web performance</span> students!</p> | |
<div><img src="awesome-photo.jpg"></div> | |
<script> | |
var span = document.getElementsByTagName('span')[0]; | |
span.textContent = 'interactive'; // change DOM text content | |
span.style.display = 'inline'; // change CSSOM property | |
// create a new element, style it, and append it to the DOM | |
var loadTime = document.createElement('div'); | |
loadTime.textContent = 'You loaded this page on: ' + new Date(); | |
loadTime.style.color = 'blue'; | |
document.body.appendChild(loadTime); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment