I am trying to make a click event with Javascript on this image button
<input type="image" alt="Skip" name="bt_cancel" id="bt_cancel"
src="http://images.eversave.com/Images/optin/skip_button_092106.gif"
onclick="return handleSubmit(this);">
I am trying to use it in Chrome but it doesn’t respond when I load the page.
I am using the following code:
if((window.location.hostname == "eversave.com")){
window.onload = function() {
document.getElementById("bt_cancel").click();
}
}
your code works absolutely fine, I think the problem is in the host name check. alert it to find out what it really is, like this: http://jsfiddle.net/AvgME/