Supported Tag
The enctype attribute is associated with <form> element only.
Example:
html
<!DOCTYPE html> < html > < head > < title >enctype attribute</ title > < style > h1 { color: green; } body { text-align: center; } </ style > </ head > < body > < h1 >w3wiki</ h1 > < h2 >enctype Attribute</ h2 > < form action = "#" method = "post" enctype = "multipart/form-data" > First name: < input type = "text" name = "fname" >< br > Last name: < input type = "text" name = "lname" >< br > Address: < input type = "text" name = "Address" >< br > < input type = "submit" value = "Submit" > </ form > </ body > </ html > |
Output:
HTML enctype Attribute
HTML enctype Attribute specifies that data will be present in the form and should be encoded when submitting to the server. This type of attribute can be used only if method = “POST”.