Converting JavaScript 'this' to jQuery '$(this)'
问题 Please have a look at the following code: <HTML> <HEAD> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> <SCRIPT type="text/javascript"> function test(target) { alert(target.nodeName); } </SCRIPT> </HEAD> <BODY> <DIV> <ul> <li onclick="test(this)">This is fair</li> <li onclick="test(this)">No its not</li> <li onclick="test(this)">Why not</li> <li onclick="test(this)">Becoz...</li> </ul> </DIV> </BODY> </HTML> The function test receives