I came to this tutorial site for their awesome Material Design input boxes. The implementation was very easy, but I just don't like the idea of including two
var $elem = '<span class="firstClass"></span>' + '<span class="secondClass"></span>';
If you read your link and the html they are not appending a span in an input which is not possible because input cannot contain children elements in html. You might mean to append to the parent of the input though and that would be simpler.