get onclick value

get onclick value

EDIT: I found this problem only in IE, not in FF

<a id="link1" onclick="target=_self" href="http://test.com/">link</a>

alert( $("#link1").attr("onclick") );

expect will be target=_self

but the result is

function anonymous()
{
target=_self
}


any idea how could I only get target=_self back