Added fix for non-form elements

Added support for non-form elements (basically anything in addition to
the existing input and textarea).