How can I start a function when clicking on a special link?

To do this, the desired element must simply have a unique ID or class.

$('.meineklasse').attr('onclick', 'myFunction()');