I am trying to append an image after the last input field in a div, any ideas as to why this won\'t work?
$(\'
Try this:
$('<img src="img/loading.gif" id="loading_img" />').appendTo('#formid-here input:last'));
You must use the insertAfter function:
$('<img src="img/loading.gif" id="loading_img" />').insertAfter($("form").find('input:last'));
The append function adds the image INTO the input with insertAfter you insert the image AFTER the input.
$("<img/>", {
src: "img/loading.gif",
id: "loading_img"
}).insertAfter($("form").find("input:last"));