Last active
May 20, 2022 11:17
-
-
Save djsnipa1/13cc65c51b1447c9c92526671f34df9e to your computer and use it in GitHub Desktop.
innerHTML
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>HTML</title> | |
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css"> | |
</head> | |
<style> | |
:root {} | |
.responsive { | |
max-width: 90%; | |
height: auto; | |
} | |
img { | |
display: block; | |
margin-left: auto; | |
margin-right: auto; | |
width: 90% | |
} | |
.center { | |
margin: auto width: 50%; | |
text-align: center; | |
/* border: 2px solid green; */ | |
padding: 10px; | |
} | |
</style> | |
<body> | |
<h3 class="center">You are not logged in</h3> | |
<a href="/login"><img class="responsive" src="../img/login.png" alt="Login to Spotify"></a | |
<div id="test"></div> | |
</body> | |
<script> | |
// change div#test content when the page loads | |
document.addEventListener("DOMContentLoaded", function(event) { | |
document.getElementById("test").innerHTML = "Hello World"; | |
}); | |
</script> | |
</html> |
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
|
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
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment