using jquery we can attach event handlers to the elements present in page, this is done inside document.ready() function. Now my difficulty is i have some elements like link
Then you'll want to use .live(). Have a look at http://api.jquery.com/live/.
.live()
Example:
$('a').live('click', function() { // Do something useful on click. });
In the example above, any A elements, whether already existing or loaded after the document is loaded, will trigger the click event.