I’ve built a small jQuery script that adds a class to witch ever input field I’m writing in. However it only works on all input fields after something is written in the first input field, see dev.resihop.nu for example.
The code:
$('.field').keydown(function () {
if ($('.field').val() !== 'Ort, gata eller kommun') {
$(this).addClass("focus");
};
});
It’s because you’re grabbing the elements one more time with
$('.field').val(). Change it to: