Doubtful the battery needs replacing, but you could check by having Apple run diagnostics on it. More likely, the system just needs to be reset. Before you go to Apple, turn the iPad completely off for 30 seconds. Then connect charger without turning it back on. Chances are, it will now show it is charging. If that doesn’t work, turn it off again. Disconnect charger. Hold the home button and power button down simultaneously until you see the Apple icon on the screen. Now reconnect the charger. It should be charging normally. If not, make an appointment at the Genius Bar. Good Luck.