![]() |
|
[HTML HELP] Adding a link to a button - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Webmasters (https://hackforums.net/forumdisplay.php?fid=141) +---- Forum: Website Construction (https://hackforums.net/forumdisplay.php?fid=50) +---- Thread: [HTML HELP] Adding a link to a button (/showthread.php?tid=6097285) |
[HTML HELP] Adding a link to a button - Mind - Jul 23, 2020 How do I add a link to this button? <button type="submit" class="submit button-primary">Your Text Here</button> Thanks. RE: [HTML HELP] Adding a link to a button - Kant Atta - Jul 23, 2020 <a href="#"><button type="submit" class="submit button-primary">Download Adobe Photoshop CC 2019</button></a> RE: [HTML HELP] Adding a link to a button - Xora - Jul 23, 2020 Bro search online, it takes like 1 second Got this from cuckoverflow Code <form action="https://google.com">RE: [HTML HELP] Adding a link to a button - Mind - Jul 23, 2020 (Jul 23, 2020 11:23 PM)Xora Wrote: Bro search online, it takes like 1 second 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 RE: [HTML HELP] Adding a link to a button - MavenGradle - Jul 25, 2020 If you prefer using JavaScript: Code const btn = document.getElementById("myBtn");Here's a live example that should demonstrate it for you: https://jsfiddle.net/9zsjybge/ RE: [HTML HELP] Adding a link to a button - Mind - Jul 25, 2020 (Jul 25, 2020 08:55 AM)MavenGradle Wrote: If you prefer using JavaScript Thank you mate. Appreciate it. RE: [HTML HELP] Adding a link to a button - MavenGradle - Jul 25, 2020 (Jul 23, 2020 11:23 PM)Xora Wrote: Bro search online, it takes like 1 second 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. RE: [HTML HELP] Adding a link to a button - Deal - Jul 25, 2020 Honestly I use to just create a regular link, and then style it myself. Example: HTML: Code <div class="button">CSS: Code .btn {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. RE: [HTML HELP] Adding a link to a button - Nachfolger - Jul 25, 2020 (Jul 23, 2020 11:23 PM)Xora Wrote: Bro search online, it takes like 1 secondMy 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. |