输出

Current URL:

示例代码

This is a demo for "dirname" attribute in the input field of Forms.

According to the text input direction, once the form is submitted, a parameter "comment.dir" with value ltr or rtl will be appended to the URL.

HTML:

  <form method="get" >
    <input type=text name="comment" dirname="comment.dir" />
    <input type=submit value="submit" />
  </form>
  <p>Current URL:<br>
  <script>
    document.write(document.
    location.href);
  </script></p>