Jul 23, 2020 11:21 PM
(This post was last modified: Jul 23, 2020 11:21 PM by Mind.)
How do I add a link to this button?
<button type="submit" class="submit button-primary">Your Text Here</button>
Thanks.
<a href="#"><button type="submit" class="submit button-primary">Download Adobe Photoshop CC 2019</button></a>
DO NOT DEAL WITH THIS MEMBER
Bro search online, it takes like 1 second
Got this from cuckoverflow
Code <form action="https://google.com">
<input type="submit" value="Go to Google" />
</form>
Jul 23, 2020 11:27 PM
(This post was last modified: Jul 23, 2020 11:28 PM by Mind.)
(Jul 23, 2020 11:23 PM)Xora Wrote: Bro search online, it takes like 1 second
Got this from cuckoverflow
Code <form action="https://google.com">
<input type="submit" value="Go to Google" />
</form>
I check before I post here. This did not work for me.
(Jul 23, 2020 11:21 PM)Kant Atta Wrote: <a href="#"><button type="submit" class="submit button-primary">Download Adobe Photoshop CC 2019</button></a>
Thank you mate <3
Jul 25, 2020 08:55 AM
(This post was last modified: Jul 25, 2020 09:02 AM by MavenGradle.)
If you prefer using JavaScript:
Code const btn = document.getElementById("myBtn");
btn.addEventListener('click', () => {
window.open("http://whatever.com");
});
Here's a live example that should demonstrate it for you:
https://jsfiddle.net/9zsjybge/
(Jul 25, 2020 08:55 AM)MavenGradle Wrote: If you prefer using JavaScript
Code const btn = document.getElementById("myBtn");
btn.addEventListener('click', () => {
window.open("http://whatever.com");
});
Thank you mate. Appreciate it.
Jul 25, 2020 09:09 AM
(This post was last modified: Jul 25, 2020 10:40 AM by MavenGradle.)
(Jul 23, 2020 11:23 PM)Xora Wrote: Bro search online, it takes like 1 second
Got this from cuckoverflow
Code <form action="https://google.com">
<input type="submit" value="Go to Google" />
</form>
You are misusing the functionality of a HTML Form to perform a simple redirect. The pimary functionality of a HTML Form is not to redirect but to submit data. Hence the input type "submit".
Using this, you would submit data to google.com which is potentially dangerous if you have any other form elements in your form.
I would recommend you to not use this method to perform a redirect if you value the privacy of your users and more importantly: this should only be used when submitting data to, for example, a backend API system.
Instead, one should opt for other solutions posted here, like for example the one posted below.
Jul 25, 2020 09:15 AM
(This post was last modified: Jul 25, 2020 09:17 AM by Deal.)
Honestly I use to just create a regular link, and then style it myself.
Example:
HTML:
Code <div class="button">
<a href="example.html" class="btn">Example</a>
</div>
CSS:
Code .btn {
font-family: 'Open Sans', sans-serif;
border: 2px solid #374C6F;
padding: 10px 40px 10px 40px;
font-size: 14px;
font-weight: 600;
text-decoration: none;
color: white;
background-color: #374C6F;
}
.button {
padding: 50px 0 0 0;
}
There are rumors that this approach is best SEO wise too.
But again nothing that I personally have confirmed, I just find it more convenient to do my buttons like this.
(Jul 23, 2020 11:23 PM)Xora Wrote: Bro search online, it takes like 1 second
Got this from cuckoverflow
Code <form action="https://google.com">
<input type="submit" value="Go to Google" />
</form>
My dog, why would you use a form to create a link? I bet you also use tables to structure your website.
Glad you got clapped, this was a retarded post for you to have made.
Je t'aime
(Apr 22, 2022 04:39 PM)-Scrub Wrote: Jokes on you, I'm not smart enough to know what he's talking about.
|