--- title: slug: Web/HTML/Element/input/password tags: - 要素 - フォーム - HTML - HTML 入力型 - HTML Inputs - HTML パスワード入力 - HTML フォーム - HTML input tag - 入力型 - リファレンス - ウェブ - password browser-compat: html.elements.input.input-password translation_of: Web/HTML/Element/input/password --- {{HTMLRef("Input_types")}} `` 要素の **`password`** 型は、パスワードを安全に入力する方法を提供します。 この要素はプレーンテキストの 1 行編集コントロールとして表示され、そのテキストは読み取られることがないように、1 つ 1 つの文字がアスタリスク ("\*") やドット ("•") のような記号に置き換えられ、隠されます。 この文字は{{Glossary("user agent", "ユーザーエージェント")}}やオペレーティングシステムによって変わります。 {{EmbedInteractiveExample("pages/tabbed/input-password.html", "tabbed-standard")}} 詳細な入力プロセスの動作は、ブラウザーによって異なっている場合があります。 例えば、モバイル端末ではしばしば、ユーザーが思ったとおりのキーを押したかどうかを確かめることができるように、入力した文字を、隠す前に一瞬だけ表示します。 これは特に、キーのサイズが小さく、押し間違いが起こりやすい、仮想キーボードの場合に役立ちます。 > **Note:** パスワードのような機密情報が含まれているフォーム (ログインフォームなど) は、 HTTPS で送信するべきです。 > 現在では多くのブラウザーで、安全ではないログインフォームの場合に警告を行う仕組みが実装されています。詳細は[安全でないパスワード](/ja/docs/Web/Security/Insecure_passwords)を参照してください。
{{anch("値")}} | パスワードを表す {{domxref("DOMString")}}、または空欄 |
イベント | {{domxref("HTMLElement/change_event", "change")}} および {{domxref("HTMLElement/input_event", "input")}} |
対応している共通属性 | {{htmlattrxref("autocomplete", "input")}}, {{htmlattrxref("inputmode", "input")}}, {{htmlattrxref("maxlength", "input")}}, {{htmlattrxref("minlength", "input")}}, {{htmlattrxref("pattern", "input")}}, {{htmlattrxref("placeholder", "input")}}, {{htmlattrxref("readonly", "input")}}, {{htmlattrxref("required", "input")}}, {{htmlattrxref("size", "input")}} |
IDL 属性 |
selectionStart , selectionEnd ,
selectionDirection , value
|
メソッド | {{domxref("HTMLInputElement.select", "select()")}}, {{domxref("HTMLInputElement.setRangeText", "setRangeText()")}}, {{domxref("HTMLInputElement.setSelectionRange", "setSelectionRange()")}} |