please anybody help me thru this case 🙁
I just started learning html css and javascript, and i have a problem. I need to make the visitor to open an extra tab with specific url after clicking a button. This specific url is actually a thankyou page, so that after they finished filling out a form and click hte button ‘Register’, they dont just got redirected to a new page, but also open an extra tab.
the button inside the body tag is declared in this code:
<input type="button" class="btn btn-masuk fw-bold" value="Daftar" style="margin-top:20px; width:200px; text-align: center; display: grid; place-items: center; line-height: var(--text-size-default); height: 40px" id="buttonRegister">
Now, the original script works fine but I dont know how to make the auto open extra tab after clicking that button, plus i cannot edit anything inside the body tag since its a template cms, including the button code itself, i can only add some script at the footer text or head meta.
i dont know if I should add an extra javascript code or else to make this works, please help
2
Answers
Try this one
If you’re unable to modify the HTML directly but can add script tags to the footer or head meta, you can use JavaScript to attach a click event listener to the button and open a new tab when it is clicked. Here’s an example script you can add to the footer or head meta
});