我無法擺脫密碼文本框上不需要的佔位符(或水印)。當密碼文本框的重點是,Android網絡瀏覽器顯示的佔位符從相關標籤元素取代,就像這樣:如何擺脫從標籤接管的密碼字段的佔位符
HTML源代碼:
<form method="post">
<label for="userName">Login name:</label>
<input id="userName" name="userName" type="text" value="" />
<label for="password">Password:</label>
<input id="password" name="password" type="password" />
<input type="submit" id="submit" name="submit" value="Log In" />
</form>
注:顯示
- 佔位符只有當文本框有焦點並且是空的。
- 在密碼輸入中使用「佔位符」HTML屬性時,僅在密碼獲得焦點時才顯示。當它收到焦點時,它會顯示標籤文字。
- 我不想刪除標籤的「for」屬性。我希望標籤可以點擊,密碼文本框可以在點擊標籤時獲得焦點。
編輯:
嘗試另一種變體(以避免 「爲」 屬性),但佔位仍然存在:
<label>Password: <input id="password" name="password" type="password" /></label>
嘿「DKL」 - 你有沒有解決這個問題?我們在某些android瀏覽器的某些頁面上看到類似的問題。 – Daryl
號我刪除了「for」屬性,但這不是一個修復,這只是一個解決方法。 – dkl