I'm trying to add a javascript onclick event to an expandable jQuery list tag.
http://screencast.com/t/bbu2fQnqP0rs
My jQuery looks like:
jQuery('ul.childpages li.expandable div.expandable-hitarea').click(function() {
piwiTracker.trackPageView('TreeClick');
alert("Handler for .click() called.");
});
How can I verify whether a click on the hitarea div (heavily nested) will trigger the function?
Edit : I added the alert handler above but I'm not getting an alert when I select the div.
By the way, the Piwik documentation to track JS events:
<a href="#" onclick="javascript:piwikTracker.trackPageView('Menu/Freedom');">Freedom page</a>