Here is my code:
$(document).ready(function() {
img$ = '';
var img$ = img$ + '<img src = ' + $('#img_loc').attr('value') + ' />';
/*#img_loc is the id of the text box where url is pasted*/
$('#add_btn').click(function() {
$('#work_area').html(img$);
});
});
I want to be able to place image after image by pasting different URLs into the img_loc text box. But with this code, I can only ever get one image to show up. Can someone please help me see what im doing wrong?
Rather than replacing the work_area each time, why not append images to it as follows: