HTML Script Tag
You can write your Event Handlers using any of the scripting language and then you can trigger those functions using HTML attributes.
If you have to use a single script functionality among many HTML pages then it is a good idea to keep that function in a single script file and then include this file in all the HTML pages. You can incluse a style sheet file into HTML document using <script> element. Below is an example.
<title> internal script></title>
This will produce following result :