首页 > 文章列表 > 如何设置在HTML中提交文本的方向?

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

411 2023-09-14

使用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>