I need to animate a div when focus an input. I tried this but is not working.
$("input").focus(function() {
$("div").animate({
marginLeft: "0"
}, 500);
});
The initial position is margin-left: -500px. The jQuery is installed correctly. When I try to do the same but with a div instead of a input It works.
$(".a_div").click(function() {
$("div").animate({
marginLeft: "0"
}, 500);
});
But I changed to an input and no longer works.