That's called a pennant, and can either be attached to the tack or head of the sail. If you have a furler and a sail that has a luff shorter than the headstay, it's necessary to hoist the halyard all the way to the top of the stay for the top spinner to turn properly, and not twist the halyard around the headstay. Storm jibs usually have a penant on the bottom (and top if used on a furler). The tack pennant serves to keep the foot of the sail clear of green water on deck, and also improves visibility under the sail.