Turn table rows and buttons into clickable links with jQuery

This simple little script often comes in quite handy when I’m working on a web app. It allow you to add an href attribute to tr, td, or input[type=button] tags to make them clickable links

$(function() {
    $("input[type=button][href], tr[href], td[href]").click(function() {
        location.href = $(this).attr("href");
    });
});
Add post to:   Delicious Reddit Slashdot Digg Technorati Google
Make comment

Comments

avatar

interesting way to make them click able links. And nicer still because you only have to do it once.

avatar

This is a super cool blog!

avatar

?????? ???? ????? ????????????, ????????????? ???!

Required. 30 chars of fewer.

Required.

captcha image Please, enter symbols, which you see on the image