티스토리 뷰

🌈 Html

<form>

James Wetzel 2022. 6. 15. 14:33
<form action="" method="get" class="form-example">
    <div class="form-example">
    	<label for="name">Enter your name: </label>
    	<input type="text" name="name" id="name" required>
    </div>
    <div class="form-example">
    	<label for="email">Enter your email: </label>
    	<input type="email" name="email" id="email" required>
    </div>
    <div class="form-example">
    	<input type="submit" value="Subscribe!">
    </div>
</form>

 

The <form> HTML element represents a document section containing interactive controls for submitting information.

 

action
The URL that processes the form submission. This value can be overridden by a formaction attribute on a <button>, <input type="submit">, or <input type="image"> element. This attribute is ignored when method="dialog" is set.

enctype
If the value of the method attribute is post, enctype is the MIME type of the form submission. Possible values:

application/x-www-form-urlencoded: The default value.
multipart/form-data: Use this if the form contains <input> elements with type=file.
text/plain: Introduced by HTML5 for debugging purposes.
This value can be overridden by formenctype attributes on <button>, <input type="submit">, or <input type="image"> elements.

method
The HTTP method to submit the form with. Possible (case insensitive) values:

post: The POST method; form data sent as the request body.
get: The GET method; form data appended to the action URL with a ? separator. Use this method when the form has no side-effects.
dialog: When the form is inside a <dialog>, closes the dialog and throws a submit event on submission without submitting data or clearing the form.
This value is overridden by formmethod attributes on <button>, <input type="submit">, or <input type="image"> elements.

 

 

반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함