Number of onto function between two sets = Number of distribution of 5 balls into 4 boxes where no ball remains empty.
Here, we can make a quadruplet on 5 is 5 →(1,1,1,4)
Thus, the number of onto functions:
=5!1!1!1!2!×4!3!
=5!2!×4!3!
=60×4
=240