Turns out I've spent two hours implementing an already existing HTML5 tag...