code exercise for 《Pro HTML5 Programming》