Clear field in web form

I created a script for a web form, but I need it to clear the field after validating a condition (if).
field name : Attachment.

thanks