that is not html but javascript language. Yes, onmouseover & onmouseout are events and to assign actions to it you should add them to the event:
<img src="image.jpg" onmouseover="alert('this is an example');" />
this is another way to do the same thing
<script type="text/javascript">
function insideImg(){alert('this is an example');}
</script>
<img src="image.jpg" onmouseover="function insideImg();" />
usually the parentheses are used to send variables values.
and a third way to do this would be using a .js file which you can create using any text editor but save it with a .js extension. the content for that file should be
function insideImg(){alert('this is an example');}
and on your html file add this tag
<script src="yourFileName.js"></script>
and then just call the function from the image
<img src="image.jpg" onmouseover="function insideImg();" />
as with any other language a function can be used by any other element that is realted to it.