Use getAttribute to detect type

This works in browsers that don't support the HTML5 form types.