Try charging it when the laptop is off as well as when it is on. If it won't charge when turned on, but will when turned off, it may not be the battery. The problem could be the charger cord. Which would need replacing.
If it won't charge either time, then I would replace the battery.