How to create buttons in HTML and JavaScript to redirect pages to different pages
P粉523625080
P粉523625080 2023-08-10 12:14:18
<p>I'm creating a website using VS code and I want to create a button that when clicked will redirect to another page on the website. </p> <p>I want to jump to a new page by clicking the "MENU" button. I've created a new file for the page I want to redirect, just not sure how to get "MENU" to act as a button and take me there. I'm using JavaScript and HTML/CSS in VS code. </p> <p>So I want the button to take me to MENU.js</p> <p>I tried using HTML to create a button but it only works if I link to the URL. I also tried the following. </p> <p><br /></p> <pre>MENU</pre> <p><br /></p> <p>But it doesn't seem to work. </p>
P粉523625080
P粉523625080

reply all(1)
P粉278379495

Why not just use link tags instead of button tags? Or for buttons use the onclick attribute:

  1. content
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!