Try turning it off (not hibernate or sleep but off) and see if it will charge then.
If it does, then you probably have a charger problem and that charger would need to be replaced.
However, if it still won't charge, even when turned off, it is probably a bad battery and that needs replacing.