In jQuery, I've been using buttons to create elements and then referencing the button clicked by using `this`. For example: 

```
$(".addphoto").click(function(){
    photo_count++;
    $(this).parent().before("<label>Add Photo: <input type='file' name='photo[" + photo_count + "]'></label>");
    });    

```

I wanted to do the same thing with a button that is created by the script, but since jQuery can only target elements that existed when it loaded, I targeted the `document` and used `.on()` instead:

```
$(document).on("click", ".addphoto", function(){
    photo_count++;
    $(this).parent().before("<label>Add Photo: <input type='file' name='photo[" + photo_count + "]'></label>");
    });  

```

The problem is that `this` now refers to `document` rather then the button that was just clicked. How do I reference that button?