如何在 HTML 中设置提交文本的方向?

htmlfront end technologyweb development更新于 2025/8/14 19:56:17

使用 dirname 属性可以提交文本的方向。该值将是输入框的名称,后跟 ".dir"。

示例

<!DOCTYPE html>
<html>
   <body>
      <h2>Student Contact Form</h2>
      <form action = "mailto:emailid@example.com" method = "post" enctype = "text/plain">
         Student Name:<br><input type = "text" name = "sname" dirname = "sname.dir"> <br>
         Student Subject:<br><input type = "text" name = "ssubject"><br>
         <input type = "submit" value = "Send">
      </form>
   </body>
</html>

相关文章


有用资源