В настоящее время я тестирую это в Mozilla FireFox 3.0.5, используя FireBug 1.3.0 с jQuery 1.2.6.
Первая попытка
document.getElementById("x").onfocus = function ()
{
var helloWorld = "Hello World";
};
Консоль FireBug:
document.getElementById ("helloworld"). Onfocus.toString () = тело функции в виде строки
$ ("# helloworld"). Get (0) .onfocus.toString () = тело функции в виде строки
Вторая попытка
$("#helloworld").focus(function ()
{
var helloWorld = "Hello World";
});
Консоль FireBug:
document.getElementById ("helloworld"). Onfocus.toString () = FireBug ничего не возвращает
$ ("# helloworld"). Get (0) .onfocus.toString () = FireBug ничего не возвращает
Что мне здесь не хватает? Почему я не могу найти обратные вызовы при присоединении их с помощью jQuery?