I have a table with a each td element containing an input tag. I wrote the following code
var elements = $('#booklist .ISBN_number');
to make an array of all of the isbn numbers contained in those input tags.
I am trying to write a jquery command to append an image to the content of those input tags. I had written
$(elements[index]).val().append("<img src = 'pics/green_checkmark.png'>");
which doesn’t work. I have checked and $(element[index]).val() does have a numeric isbn value. Why can’t I append to it? (I wan’t to image to show up on the right of the input tag)
The jQuery
valfunction returns a string of the current value of the element.If you want to append the image after the input tag, you can use the
afterfunction.