Is it possible to register a click response on a Div?

I am trying to create a custom component that does something on the js side when clicking the title.

I manage to get it working if I create a div with class “block_title” in HTML and add the following to the script:
$(".block_title").on(“click”, function(){
console.log(‘clicked title’);

I want to have all the functionality in my custom component using CustomJS. I tried something like this, but that seems not to work:
header = Div(text=‘Title’, css_classes=[‘block_title’])
header.js_on_event(“click”, CustomJS(code=“console.log(‘clicked title’)”))

Am I missing something? How would what I am trying be possible?

Bokeh’s Div doesn’t send any events that Bokeh cares about. If you really want it to be clickable, you have to either use what you have already come up with or create a custom model that probably extends Div. Alternatively, just use a Button.

Ok, thanks.