A 5.9-magnitude earthquake jolted Taiwan yesterday, shaking buildings in the capital and injuring three schoolchildren, officials said.