L298N Motor Driver Acting Wierd

I'm trying to use a L298N Motor Driver with my Arduino Leonardo and I plugged all the wires in the way they are meant to go. This is the motor river:

I plugged a 9V battery into the power and ground pins of the board and then plugged the input pins into the arduino. It didn't turn the motors so to test them, I plugged the input pin into the 5V plug of my arduino. That still didn't work so I tried plugging the 5V connector on the motor driver board into the input pin. That made the motor spin. So I took a multimeter and tested the pins on my arduino and they were all outputting the desired amount. So I can't image what would be wrong. Any help would be appreciated.

9V block batteries are for smoke alarms, and are totally unsuitable for motors. Same for the 5V Arduino output.

It is best to always use a separate power supply for motors and servos, connecting all the grounds.

Post a link to your motor and a wiring diagram.

Finally, the L298 is ancient, inefficient and weak, and cannot handle many modern motors.