on click

3 replies · opened Nov 17, 2021

JjazzyflashNov 17, 2021

How can I program the following code to open the link in a new window

<button class="btn" onclick="location.href='mylink.com'" target='_blanK'>
![attachment](images/Read More.png)
</button>

target='_blanK'> doesn't seem to work for this coding., can you please point me in the right direction to solve this issue.
Thank you for your continued support.

SSemicolon WebSTAFFNov 18, 2021

Hello,

You will need to use the `` Tags in order to use the relevant html attributes. Example:
[ch_pre]Text[/ch_pre]

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

JjazzyflashNov 18, 2021

In my question I said that I am using code "onclick=”location.href=’mylink.com'”, When Using onclick=”location.href how do I code this to open in a new window????? Or how do I add a image button to the code example that you provided

SSemicolon WebSTAFFNov 19, 2021

Hello,

Apologies but the `` Tag does not support opening the Link in New Window as this HTML Tag is not for this Purpose. You might need to use Custom JS Codes for this which we currently cannot provide according to the Item Support Policy: https://themeforest.net/page/item_support_policy .

You can consider using:
[ch_pre]
attachment
[/ch_pre]

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard