<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8"> <Linkhref= "Style/css.css"rel= "stylesheet"type= "Text/css" /> <Scriptsrc= "Js/jquery-1.7.2.min.js"></Script> <Script>$ (document). Ready (function() {Console.log (" Ready"); $("#textbox"). Hover (function() {Console.log ("Fdsfds"); This. Title="Test"; }, function(){ This. Title="OK"; } ); }); </Script> </Head> <Body> <PID= "TextBox">Pppppppppppp</P> </Body></HTML>
Here this is actually an HTML element (textbox), TextBox has the title property, so it is absolutely no problem to write.
But if you change this to $ (this) it is not the case, error--reported. $ (this) represents a jquery object. This is the difference between this and $ (this).
To use $ (this), you have to write this.
$ ("#textbox"). Hover ( function() { $ (this). attr (' title ', ' Test '); , function() { $ (this). attr (' title ', ' OK '); }
The difference between this and $ (this) in jquery