function mytest(){ alert("hello world"); console.log("is ok"); }
<div id="first" onclick="mytest();">hello world</div>
.first{ background: red; }