Описание тега self-invoking-function

A self-invoking function is a function that is invoked (started) automatically, without being called.

That is a function which invokes itself as soon as possible when the browser is interpreting your ecma-/javascript. Therefore, its very unlikely that you can successfully act on DOM elements here. It will be executed as soon as it is encountered in the JavaScript.