If element exists in a document
<p>It's possible situation that my function is use out of date jquery element. For example when I use closer and callback:</p>

<pre><code>    $("input").each(function () {
       var input = $(this);

       //here for example we remove input from DOM
       //and insert the new one input

       $.ajax(url, function(){
          fun(input)
       }
    });

function fun(input){
//do something
input.val('newValue')
}
</code></pre>

<p>QUESTIONS ARE: How can I be sure that reference on variable is still right. And if element has been reacreated how can I get new reference on new input (input doesnt have id and classes)?</p>

<p><strong>UPDATE1:</strong> I made small update. we use old <em>input</em> reference in function <em>fun</em>. And <em>newValue</em> will not apply to new input coz current <em>input</em> is old value.</p>
