x
 
<!DOCTYPE html>
<html>
<head>
<title>JS tutorial</title>
<style type="text/css">
body {
    margin-top:30px;
}
div, p {
    border:1px solid #ccc; 
    padding:4px;
    font-variant:small-caps;
    cursor:pointer;
}
p+p {
    border:none;
    cursor:default;
}
</style>
<script type="text/javascript">
    function evalElm(elm) { 
        document.getElementById("write").textContent="You clicked on    <"+elm.nodeName+"> element";
    }
</script>   
</head>
<body>
<div onclick="evalElm(this)">Click here!</div>
<p onclick="evalElm(this)">No, click here!</p>
<p>&nbsp;</p>
<p id="write"></p>
</body>
</html>