...select a tab from a text link instead of clicking a tab itself

...select a tab from a text link instead of clicking a tab itself


how do I use this code exactly..
var $tabs = $('#example').tabs(); // first tab selected
$('#my-text-link').click(function() { // bind click event to link
$tabs.tabs('select', 2); // switch to third tab
return false;
});
any example of that in action?