I have code like this:
<div id='my-div'></div>
When a user clicks on this div, I would like to open http://google.com in a new tab or window. I'm using jquery as follows:
$('#my-div').click(function() {
// what do I put here?
});
I have code like this:
<div id='my-div'></div>
When a user clicks on this div, I would like to open http://google.com in a new tab or window. I'm using jquery as follows:
$('#my-div').click(function() {
// what do I put here?
});
For a new window:
$('#my-div').click(function() {
window.open("http://www.google.com", '_blank');
});
or for a new tab:
$('#my-div').click(function() {
window.open('http://google.com');
});