Skip to content

Instantly share code, notes, and snippets.

@djsnipa1
Last active May 20, 2022 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djsnipa1/13cc65c51b1447c9c92526671f34df9e to your computer and use it in GitHub Desktop.
Save djsnipa1/13cc65c51b1447c9c92526671f34df9e to your computer and use it in GitHub Desktop.
innerHTML
<!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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment