本文演示了点击不同输入框,出现不同的背景色。
淘建站为您提供更多_其它特效_jQuery插件_背景_background,在此特别感谢您对我们的支持与厚爱!
演示不了,点击反馈
下载 287 次
觉得不错,可打赏下作者
免费共享
HTML
<label for="bir">Ad</label>
<input type="text" id="bir">
<label for="iki">Soyad</label>
<input type="text" id="iki">
<label for="uc">URL</label>
<input type="text" id="uc">
<div class='background'></div>jQuery
$("#bir").focusin(function() {
$('.background').css("background-color", "#ff9800");
});
$("#iki").focusin(function() {
$('.background').css("background-color", "#03a9f4");
});
$("#uc").focusin(function() {
$('.background').css("background-color", "#e91e63");
});
$("#bir, #iki, #uc").focusout(function() {
$('.background').css("background-color", "");
});

