My iphone won't stay on unless it's plugged in?

I have had this iphone for like a month and It has worked perfectly in till 3 days ago. I charged it and went to turn it on but it wouldn't turn on. So i pressed the power and the back button and it reset. Then it would stay on for like a minute and then totally turn off and I would have to reset it again. I plugged it in my computer and it worked perfectly?! I don't know if its a battery shortage or something but I don't get it. It only works on the charger…

Make a warranty claim

Sounds like the battery is pooched. I'm going to guess that even though you've only had it for a month, it definitely wasn't new when you got it.

Bad battery. Make a warranty claim. That's what warranties are for

Sounds like a battery shortage go to a apple store and have um troubleshoot for you.

Check with your local Apple store for technical help.

That happened to me. I think all you have to do is reboot it ( press the top button and main button until a white apple shows up on the screen ) * ignore the "turn off" thing…