Submitted by newaction on Fri, 2011-12-09 12:47
$("#theElement").click();
--------------------------------------------------------------------------------
<script type="text/javascript">
$(function(){
$('#thickboxButton').click(function(){
$('#thickboxId').click();
});
});
</script>
<input id="thickboxButton" type="button" value="Click me">
<a id="thickboxId" href="myScript.php" class="thickbox" title="">Link</a>
--------------------------------------------------------------------------------
$("#your_item").trigger("click");
<a href="somewhere" id="mylink">MyLink</a>
<script>jQuery('#mylink').click(function(){
// do whatever I want here, then redirect
window.location.href = "http://stackoverflow.com";
});
function doClick(){
jQuery('#mylink').trigger('click');
};
// trigger the redirect now
doClick();
</script>
--------------------------------------------------------------------------------
- Login to post comments