<html>
<head>
<style>
.tagging {
border: 1px solid black;
width: 20px;
height: 30px;
}
</style>
<script>
window.onload = function() {
var div = document.getElementsByTagName("div");
div[0].class = "tagging";
}
</script>
</head>
<body>
<div></div>
</body>
</html>
This is the code I wrote. I am curious why it does not seem to work when assigning the class attribute through JavaScript, but works fine when done inline in HTML
<div class="tagging"></div>