If the laptop still switches on and works fine, then it means your battery has issues.
First you can find out if the battery has gone bad by detaching it from the laptop and then plugging the charger to the laptop. In almost all the cases, it’s the battery that is causing the problem. This is one of the most common laptop problems.
Battery won’t charge or gets drained too quickly