1

I have created two buttons in my index.html. Now these buttons are directed at two other html files that are in the same folder, but when I click on those buttons, nothing happens. And my index.html file shows some errors that goes ; expected.

Here is my code of index.html

<!DOCTYPE html>
<html>
    <head>
        <title>Flask and SQLite </title>
    </head>
    <body>
        <h1>Build Web App Using Flask and SQLite</h1>
        <button class="btn" type="button" onclick="window.location.href='{{ url_for('join') }}';">Fill form to get updates</button><br/>
        <button class="btn" type="button" onclick="window.location.href='{{ url_for('participants') }}';">Check participant list</button>
    </body>
</html>

enter image description here

rensothearin
  • 670
  • 1
  • 5
  • 24
TariqShah
  • 25
  • 7
  • Is your problem similar to this? https://stackoverflow.com/questions/27539309/how-do-i-create-a-link-to-another-html-page – rensothearin Mar 07 '23 at 05:18
  • Are you using any frameworks? `{{}}` syntax is not valid vanilla HTML. – cSharp Mar 07 '23 at 05:19
  • @rensothearin no it's a little bit different. I already check that one. thanks for sharing by the way. – TariqShah Mar 07 '23 at 05:24
  • @cSharp i am doing this in my visual basic. I am trying to use flask to develop a simple web app – TariqShah Mar 07 '23 at 05:25
  • Not a fix but note that the [
    ](https://html.spec.whatwg.org/dev/embedded-content.html#the-br-element) tag does not use and does not need a closing slash and never has in any HTML specification.
    – Rob Mar 07 '23 at 08:15
  • 1
    Does this workaround help? [Making a – Peter Krebs Mar 07 '23 at 08:27
  • Thank you everyone for the help. i found the bug. now its working. i didn't put the index.html in the same folder with other buttons. when I did so it works fine now – TariqShah Mar 07 '23 at 10:50

0 Answers0