title: HTML attribute class
body: <p>Is there any way to write class for HTML attributes?
  I'm having problem with a code</p>
  <pre><code>(i.e) &lt;input type=&quot;text&quot; class=&quot;float-label&quot; required/&gt;
  </code></pre>
  <p>In the above code my 'float-label' class works fine when the input attribute having the attribute 'required'. Once I remove the required attribute the class behave differently.</p>
  <p><strong>Update:</strong></p>
  <p>When the input field has <code>required</code> then the class takes the <code>class:invalid</code> state, when removing the <code>required</code> attribute then the class takes <code>class:valid</code> condition. I don't know why the class takes valid condition when the input have <code>required</code> attribute.</p>