Strike the target block with your bow and the firework will go upwards in the air.
Go through this guide and follow step-by-step instructions to make a Target Block Firework.
The first thing you need to do is to bring the crafting table out of your inventory and open up 3*3 crafting grid. Add blue dye, gun powder, fire charge respectively in a single row and you will get a Firework star in the right side box of the crafting table. Bring this in your inventory.
Add firework star, paper and gunpowder on the crafting table in the same way as shown in the image below. You will get 3 Firework rockets in the right side box of the crafting table. Bring these in your inventory.
The next thing you need to do is to place a spruce fence on the ground and then add a target block at the top.
Place a dispenser at the back side of the target block and fill the dispenser with Firework rockets.
Strike the target block with your bow and the firework will go upward in the air.