I'm working on a WordPress template. The following code works fine with "Click Function". But now I want to add keyboard shortcut to this function, so that visitor will get choice for both mouse click and keyboard shortcut to perform same function. I tried to apply this method after e(".bookmark").live("click", function () { line but it didn't solve the problem, Instead it broke the button too.
A little help will be appreciated. Thank you.
function whatever_do_js(e, t) {
    loadingImg = e.prev();
    loadingImg.show();
    beforeImg = e.prev().prev();
    beforeImg.hide();
    url = document.location.href.split("#")[0];
    params = e.attr("href").replace("?", "") + "&ajax=1";
    if (t) {
        jQuery.get(url, params, function (t) {
            e.parent().html(t);
            if (typeof whatever_after_ajax == "function") {
                whatever_after_ajax(e)
            }
            loadingImg.hide()
        })
    }
}
jQuery(document).ready(function (e) {
    e(".bookmark").live("click", function () {
        dhis = e(this);
        whatever_do_js(dhis, 1);
        return false
    })
})
 
     
     
    