Small pure javascript to transform a input field into a tag field