type HTML атрибут - тип елемента
Атрибут type визначає тип вмісту або поведінку елемента, залежно від контексту його використання.
Атрибут type використовується з елементами <input>, <script>, <link>, <style>, <embed>, <object>, <source> та <a>.
Для елементів <script> та <style> атрибут type є необов'язковим, оскільки text/javascript та text/css відповідно є значеннями за замовчуванням у HTML5.
Синтаксис
HTML
<input type="text">Приклади використання
Результат
<label for="username">Ім’я користувача:</label>
<input type="text" id="username" name="username"><br><br>
<label for="password">Пароль:</label>
<input type="password" id="password" name="password"><br><br>
<label for="email">Електронна пошта:</label>
<input type="email" id="email" name="email"><br><br>
<input type="submit" value="Надіслати">
<p>Приклад використання <code>type</code> для інших елементів:</p>
<link rel="stylesheet" href="/assets/styles/index.css" type="text/css">
<script src="/assets/js/index.js" type="module"></script>