Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
117 views
in Technique[技术] by (71.8m points)

javascript - HTML按钮onclick事件(HTML button onclick event)

3个按钮3点击事件

This might be a very basic question;(这可能是一个非常基本的问题;)

believe me I found very hard to find the answer to this question on the internet.(相信我,我发现很难在互联网上找到这个问题的答案。) I have 3 HTML pages stored in my server (Tomcat locally) & i want to open these HTML pages on a button click.(我在我的服务器(本地Tomcat)中存储了3个HTML页面,我想在按钮点击时打开这些HTML页面。) Any help would be highly appreciated.(任何帮助将受到高度赞赏。) Here is my code,(这是我的代码,) <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Online Student Portal</title> </head> <body> <form action=""> <h2>Select Your Choice..</h2> <input type="button" value="Add Students"> <input type="button" value="Add Courses"> <input type="button" value="Student Payments"> </form> </body> </html>   ask by bynu022 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try this:-(试试这个:-)

<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Online Student Portal</title> </head> <body> <form action=""> <input type="button" value="Add Students" onclick="window.location.href='Students.html';"/> <input type="button" value="Add Courses" onclick="window.location.href='Courses.html';"/> <input type="button" value="Student Payments" onclick="window.location.href='Payment.html';"/> </form> </body> </html>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...