Having this table
<table>
<tr id="1"><td>1</td></tr>
<tr id="1"><td>1</td></tr>
<tr id="2"><td>2</td></tr>
</table>
I need to emulate a anchor click when user clicks a table row, something like the following.
jQuery('tr').click(function(){
var id = jQuery(this).attr('id');
var anchor = jQuery('<a />').attr({href:'index.php?id=' + id,rel:"{handler: 'iframe', size: {x: 800, y: 600}}"});
anchor.click();
});
I know how to redirect, or visit a link in jQuery, the question here has to do with “rel” attribute of the anchor.
Thanks
You need to attach the a tag to the dom tree.