mulit selector with on click and change

mulit selector with on click and change

hey guys im trying to get two different selectors with different events to execute the same code...is this possible or do i have to duplicate code?...thank you

  1. $('.input-file').on('click', function() {
  2. {);
  3. $('#uploaded-images').on('click', '#remove', function(event){
  4. });

  5. // these two functions to execute

  6.         if (uploads === 0)
            {
                $('#image-status').text("Add up to " + max_uploads + " images.");
            }
            else if (uploads === 1)
            {
                $('#image-status').text(uploads + " Image selected. Add up to " + (max_uploads - uploads) + " more.");
            }
            else if (uploads > 1)
            {
                $('#image-status').text(uploads + " Images selected. Add up to " + (max_uploads - uploads) + " more.");
            }