I'm trying to design an HTML Form class and I need some help with some concepts.

Buttons, for example, are easy to visualize as "objects" but when I create an HTML form, all I really need is for the code (class, function, method, or whatever I wind up using) to write a bunch of HTML. The button has no properties and the only method is writing itself as HTML code.

Does this mean that it makes more sense to write the button code as a function as opposed to a class? Or should the button instead of being an object be a method of the Form class? The same applies to all the other form objects such as select, radio buttons and check boxes.

BTW, I'm saving the state of radio buttons and other elements in a different object such as a shopping cart.

Thanks for your help!