Easy JQuery - why doesnt it work?

Discussion in 'jQuery' started by makemoneyfromgoogle, Mar 8, 2010.

  1. #1
    I just want to create a simple script that gives two alert messages
    one on mouseover / one on mouseout

      $('input').bind('mouseover', function (){ alert("Hello"); });
        $('input').bind('mouseout', function (){ alert("Goodbye"); }); 
    PHP:
    What am I doing wrong?
    Any JQuery pros out there?

    mohamed elgharib
     
    makemoneyfromgoogle, Mar 8, 2010 IP
  2. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Hi,

    place these functions in document.ready():
      
    $(document).ready(function(){
    $('input').bind('mouseover', function (){ alert("Hello"); });
    $('input').bind('mouseout', function (){ alert("Goodbye"); });
    }); 
    Code (markup):
    Regards :)
     
    koko5, Mar 8, 2010 IP