I have a jQuery QR Code generator that creates an image of a QR code based on the text you type into an input. The QR code and image source updates in real time as you alter your input. 
What I need is to take the src of the image and place it in its own input that updates as you type. I was able to get the value of the src using this:
var imageSRC = $('.qr-preview img').attr('src');
$('input#code_img_src').val(imageSRC);
This works perfectly fine, however it only applies the value of the image when the PAGE LOADS, not each time the img src changes. Is there a way to make it so that every time the src changes that function updates in real time? I'm probably overlooking something simple here, and I've researched things like setInterval but I that's not exactly what I'm looking for. Any help would be greatly appreciated.  
 
     
     
    