jQuery find last input and append

前端 未结 3 920
一生所求
一生所求 2021-01-23 04:03

I am trying to append an image after the last input field in a div, any ideas as to why this won\'t work?

$(\'

        
3条回答
  •  清歌不尽
    2021-01-23 04:55

    You must use the insertAfter function:

    $('').insertAfter($("form").find('input:last'));
    

    The append function adds the image INTO the input with insertAfter you insert the image AFTER the input.

提交回复
热议问题