I am trying to put code into a block that contains a Javascript onclick handler. Have been trying to figure out how to use drupal_add_js, but cannot figure out how to make an onclick function work. I believe I may need to use Drupal behaviors.
I have read the documentation, but it is not clear. Here is what I am trying but doesn't work. Any help would be appreciated.
drupal_add_js('jQuery(document).ready(function() { $("#trial").click(function() { alert("Handler called." ); } ); } );', 'inline');