Though you can charge your Apple iPad by attaching it to a Windows or Mac computer, the charging will only work when the iPad is in sleep mode.
The fastest way to charge your iPad is with the included 10W USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter.
When attached to a computer via a standard USB port (most PCs or older Mac computers) iPad will charge, but only when it’s in sleep mode. Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.