I am using an onblur event on a form and currently have this as code for the loading to work…
$('#username').after('<div class="loading"></div>');
Only this will work for the id of username, I thought changing it to (this) like
$(this).after('<div class="loading"></div>');
Would in turn make the div appear after the input field of any fields where the script is used, why is this not happening??
Update
Just tried the following which also does not work… Where I assigned the class loading to the input field.
$('.loading').(this).after('<div class="loading"></div>');
it must be appending but as the div is empty its not showing, see in the firebug it should be there. or for testing purpose you can try
see this fiddle http://jsfiddle.net/QxMWh/
and this one http://jsfiddle.net/QxMWh/1/