I guess it is a very dumb question. I have input element (type=\'text\') that should have required attribute conditionally. My code looks like: