Please, help writing a script!

I've attached the HTML page and my script that should tell tags, but shows blank fields.

Please, help me to fix it.

script.zip (10 KB)

Look at the last line, you forgot to remove endif

Thank you! That works!