I would like to have a button that redirects to a given URL and opens in a new tab. How can this be done?
Use window.open instead of window.location to open a new window or tab (depending on browser settings).
window.open
window.location
Your fiddle does not work because there is no button element to select. Try input[type=button] or give the button an id and use #buttonId.
button
input[type=button]
id
#buttonId