This is how it's properly done:
Things I did:
- modernized coding style
- switched to type attribute instead of language
- added semicolons on each ending line
- removed redundant
if
keyword
- added a closing curly bracket which was originally missing
- removed comparison with a string true, comparison with boolean values do not need this