HTML <input> Özelliği kabul et

❮ HTML <input> etiketi

Örnek

Kullanıcının dosya girişi iletişim kutusundan hangi dosya türlerini seçebileceğini belirtin:

<form action="/action_page.php">
  <label for="img">Select image:</label>
  <input type="file" id="img" name="img" accept="image/*">
  <input type="submit">
</form>

Tanım ve Kullanım

acceptÖznitelik, kullanıcının dosya girişi iletişim kutusundan hangi dosya türlerini seçebileceğine ilişkin bir filtre belirtir .

Not: Özellik acceptyalnızca ile kullanılabilir <input type="file">.

İpucu: Bu özelliği doğrulama aracı olarak kullanmayın. Dosya yüklemeleri sunucuda doğrulanmalıdır.


Tarayıcı Desteği

Tablodaki sayılar, özelliği tam olarak destekleyen ilk tarayıcı sürümünü belirtir.

Attribute
accept 26.0 10.0 37.0 11.1 15.0

Sözdizimi

<input accept="file_extension|audio/*|video/*|image/*|media_type">

İpucu: Birden fazla değer belirtmek için değerleri virgülle ayırın (örn <input accept="audio/*,video/*,image/*" />.

Özellik Değerleri

Value Description
file_extension Specify the file extension(s) (e.g: .gif, .jpg, .png, .doc) the user can pick from
audio/* The user can pick all sound files
video/* The user can pick all video files
image/* The user can pick all image files
media_type A valid media type, with no parameters. Look at IANA Media Types for a complete list of standard media types

❮ HTML <input> etiketi