Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML html help with button code

aj nas

New Coder
I have a button code that looks like this. I want the link to open in a new tab when pressing the button. I can't seem to modify the code to do that. Can someone help.
This is the code:
<input _blank="" onclick="window.location.href='https://checkout.square.site/buy/VBTRXPKD2OXCMA2FQD3RMRRR'" type="button" value="Resume and cover letter" /></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal;"><div style="font-size: 100%;"><form></form></div><div style="font-size: 100%;"></div>
 
Solution
Tested and works

"window.open('https:\/\/checkout.square.site/buy/VBTRXPKD2OXCMA2FQD3RMRRR', '_blank')"

Put this instead of your window.location.href(), and delete that _blank=""
Why dont you use anchor tag and make it look like a button?

HTML:
<a href='https://checkout.square.site/buy/VBTRXPKD2OXCMA2FQD3RMRRR' target="_blank" class="button">Resume and cover letter"</a>

Now use .button in css to style it to look like a button.
 
I can't I'm using it on blogger to promote tutoring services. It does not enabled for coding. So I had to use and html code for a button. But the button does not open a new page. I prefer if it opened a new tab when clicked.
 
I have a button code that looks like this. I want the link to open in a new tab when pressing the button. I can't seem to modify the code to do that. Can someone help.
This is the code:
<input _blank="" onclick="window.location.href='https://checkout.square.site/buy/VBTRXPKD2OXCMA2FQD3RMRRR'" type="button" value="Resume and cover letter" /></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal;"><div style="font-size: 100%;"><form></form></div><div style="font-size: 100%;"></div>
Hi there,

Welcome to Code Forum!

Please add your code into our Code BBCode feature. To learn more about how to use our BBCode feature, please click here.

I’ll help you soon! Just need my laptop.
 
Tested and works

"window.open('https:\/\/checkout.square.site/buy/VBTRXPKD2OXCMA2FQD3RMRRR', '_blank')"

Put this instead of your window.location.href(), and delete that _blank=""
 
Solution

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom