Hya,
I would like to run a bit of code only if the focused text-box has a certain ID.
Here is my code:
$("input:text").focus(function() {
if ($(this) == $("#divid")) {
//action
}
});
It does not work, I’m not to sure why.
Try comparing by the id directly.