how to obtain the content of an input element with only html?

后端 未结 1 404
我在风中等你
我在风中等你 2021-01-24 23:33

I need to pass the content of the input to the url of the form with only html , is this possible ?

What i need to do is something like this :

相关标签:
1条回答
  • 2021-01-24 23:58

    If you are using the form with get method, you don't have to set the action like this. Just set it to <form action="./busPorMatricula.html"> and the browser will add the key and the value to the URL.

    <form action="https://www.google.co.il/">
      <input type="text" name="matricula" />
      <input type="submit" value="submit" />
    </form>

    Note: You can't see the result in the snippet because the security issues in StackOverflow. You can see it in: http://output.jsbin.com/kelocu. After you submit the form you will go to google.com with the key and value in the URL.

    0 讨论(0)
提交回复
热议问题