$(document).ready(function() { $('.bt_orcar').click(function() { $location = $(this).attr('id'); document.location = $location; return false; }); });