0

Can somebody help me with the below :

I am trying to build a site with many pages using Google's Appscript. But I am stuck as to how can I redirect to those pages using button. Obviously it would be a Javascript code. I am trying to use the addEventListener function.

 <body>
<div class='container'>
  <h1>Welcome to the Ticket Tracker!</h1>
  <input id='my_input' placeholder="Recipient's Email"><br>
  <input id='my_input_fname' placeholder="First Name"><br>
  <input id='my_input_fname' placeholder="Last Name"><br>
  <button id='my_button_new_ticket'>NEW TICKET</button>
  <button id='my_button_update_ticket'>SEARCH TICKET</button>
  
  <p id='my_paragraph'></p>
  
  <script>
    document.getElementById('my_button_new_ticket').addEventListener('click', _ => {
      window.location.href='index.html'
            
  </script>
</div>
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • I tried window.location.href but it didnt work as I do not know the URL of my pages beforehand so tried using filename which obviously would not work. hence needed a roundabout – Ankit Punamiya Aug 29 '20 at 14:30
  • If the answers in the duplicate question(s) linked above don't satisfy you, ask a new question/edit your current question with your attempts at implementing the solutions there and where or why they didn't work. See [mcve] – TheMaster Aug 29 '20 at 15:17

0 Answers0