JavaScript to open new Tab Window

Hi Team,

I am using the following JS and CSS as column links on my home page. But I want two of the links of open new windows because they are external links. How can I alter the code to do that…

jQuery( document ).ready(function($) {
$(’#column-boats’).on(‘click touched’, function() {
window.location.href = ‘https://www.easttexasboatrentals.com/home.html’; });
$(’#column-vans’).on(‘click touched’, function() {
window.location.href = ‘/reservations/’; });
$(’#junglefloat’).on(‘click touched’, function() {
window.location.href = ‘https://www.easttexasboatrentals.com/home.html’; });
});

CSS:
#column-boats,
#column-vans,
#junglefloat {
cursor: pointer;
}

Maybe try this https://stackoverflow.com/questions/55362152/how-to-open-a-new-tab-in-javascript instead of window.location.href

Hello @bluetroop2,

Thanks for writing in!

Using a custom JS and CSS to make the entire column as a link is outdated. With the latest version, you can actually changed the HTML tag of the column and make it used the </a> tag.

If you want your column link to open to a new tab, simply check the “New Tab” option in the Column > Link element settings.

Hope this helps. Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.