<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
.one{
color:red
}
</style>
</head>
<body>
<p class="one">Click on the button to display the class name of this paragraph.</p>
<button onclick="myFunction()">Click Me</button>
<p id="point"></p>
<script>
var x = document.getElementById("point");
var elem = document.getElementsByTagName("p")[0];
function myFunction(){
x.innerHTML = elem.className;
}
</script> </body>
</html>