added support for different html elements besides inputs