HTML背景图像:输入内部的ulr()



我在html页面中尝试了这段代码。

<input type="password" onchange="{background-image: ulr("image.png")}">

但它不起作用。怎么了
感谢您的邮件。

试试这个:

function changeBackground(el){
el.style.backgroundImage = "url('https://picsum.photos/200/300')";//or what ever you want
}
<input type="password" onchange="changeBackground(this)">

最新更新