Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> HTML

วิธีการทำงานกับแอตทริบิวต์ dirname ใน HTML?


ใช้ dirname คุณลักษณะช่วยให้คุณสามารถส่งทิศทางข้อความ ค่าจะเป็นชื่อของอินพุตตามด้วย “.dir ”.

ตัวอย่าง

คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อทำงานกับ dirname แอตทริบิวต์ −

<!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>