Мне бы хотелось, чтобы отдельный DIV, содержащий ввод, также менял цвет фона. Как добавить его в существующий код, который работает?
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("input:[type=text]").focus(function () {
jQuery(this).addClass("highLightInput");
});
jQuery("input:[type=text]").blur(function () {
jQuery(this).removeClass("highLightInput");
});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$("input:[type=text]").focus(function () {
$(this).addClass("highLightInput");
$(this).parent('div').addClass('highlight');
});
$("input:[type=text]").blur(function () {
$(this).removeClass("highLightInput");
$(this).parent('div').removeClass('highlight');
});
});
</script>