DOM事件浏览器密码自动填写? [英] DOM event for browser password autofill?

查看:152
本文介绍了DOM事件浏览器密码自动填写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立的网站上有一个相当标准的用户名/密码输入框。密码框包含一个包含密码的div,覆盖在其上,设置为 display:none; 对焦或点击。

I've got a fairly standard username/password entry box on a web site I'm building. The password box has a div containing "Password" overlaid on top of it, which is set to display: none; on focus or click.

这个工作很好,直到用户要求他们的浏览器记住密码:在这种情况下,你可以结束所附屏幕截图的情况。

This works great until the user asks their browser to remember the password: in that case you can end up with the situation in the attached screen shot.

我的问题是:是否有一个可以绑定的事件会触发,当密码字段自动填充,所以我可以隐藏帮助div?

My question then is: is there an event that I can bind to that will trigger when the password field autofills so I can hide the help div?

推荐答案

这是我提出的肮脏的解决方案:

Here's the crappy solution I came up:

我添加了一个间隔定时器到站点检查框的值,并隐藏帮助文本,当该值不是一个空字符串。

I added an interval timer to the site that checks the value of the box, and hides the help text when the value is not an empty string.

这篇关于DOM事件浏览器密码自动填写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆