Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

HTML5新要素 input type="url"

概要

input type="url"タグについて説明します。

内容

input type="url"はURL入力欄です。
http://、https://などではじまらないアドレスを入力すると
エラーになります

サンプル

<!DOCTYPE HTML>
<html lang="ja-JP">
  <head>
    <meta charset="UTF-8" />
    <title>input type="url"</title>
  </head>
  <body>
  <form action="">
    url:<input type="url" name="url" id="url" value="" placeholder="urlをご入力ください" style="width:200px;" required />
    <input type="submit" name="" value="submit" />
  </form>
  </body>
</html>

完成画面のキャプチャ