It would be nice if the label element and input element are reordered by Mendix. Now the label comes before the input element which means it is not possible to style your label with CSS based on the input of the textbox. Creating for example floating labels for your input widgets is therefore not possible, or at least not in an easy way.
Reordering the html elements as below gives a lot more possibilities for creating dynamic textboxes.
<div> <input> <label>Email address</label> </div>
I understant what you are trying to achieve, but I think for screen readers this might make things wierd, and there are probably some other reasons why this is not done.
As for css floating fields, this is def an elegant solution to trigger some animtion with css classes.
Maybe you could make a widget to do this, or some JS?