Re: Why won't my HTC M8 charge
The most common issue is a bad USB cable. The connectors get loose inside the cable jacket, keeping it from providing enough current. That's why it indicates that it's charging but you're still losing power. Other possibilities are a bad charger or USB port inside the phone.
My first suggestion would be to try a new USB cable (not just another one you've already used) and see if that works. Stay away from the really thin ones because they can also limit the current. I found that out the hard way with a Dollar Tree cable. Lol. If you still have problems, make sure the plug fits snug in the phone port. Being loose there could be both a symptom of a worn cable or a bad port, which is why I suggested the cable first. If that seems fine, then I'd try a new charger. Make sure any charger you try is rated a minimum 1.5A like the OEM one. Those suggestions cover most all slow charging issues. There is also a chance the battery itself is bad, but that usually has other symptoms associated with it.