onclick函数时,无法获取this值

$("p").click(function(){
    console.log($(this));
})

按照上述操作,会得到所点击的对象

<p onclick="test()">点击我</p>

function test(){
    console.log(this);
}

上述操作,则无法获取点击的对象,提示undefined。

正确操作

<p onclick="test(this)">点击我</p>

function test(e){
    console.log(e);
    console.log($(e));
}