Developing classes for each HTML item (Should I?)

I’m so sick and tired of writing forms, and switching between PHP and HTML, always remembering to do things like “htmlspecialchars()” on everything, but most of all, I just really like working with classes rather than HTML!

I’m thinking of writing a small library to make it easier to add HTML elements (plus some JavaScript functionality) via code instead, something like this:

$frm = new HTMLForm("submitURL.php", POST, "css_class");
$nameTF = new HTMLText("name", "", 100, "tf_class"); 
$emailTF = new HTMLText("email", "", 200, "tf_class");

$frm->addChild($nameTF, "Enter your name:");
$frm->addChild($emailTF, "Enter a valid email address:");

$sbtn = new HTMLSubmitBtn("send", "Send", "send_btn"); 
$pbtn = new HTMLSubmitBtn("preview", "Preview", "preview_btn");

$frm->addSubmitButton($sbtn);
$frm->addSubmitButton($pbtn); 

$frm.render();

It seems like more code than just writing out the HTML (and actually, it is), but it does save some effort and code when the JavaScript snippet parts are added in which handle validation etc.

I’m looking for valid reasons why this is NOT a good idea so I don’t waste time creating these. Something like:
“Classes like this already exist, Andreas. Here is the link for it…”
“This would be a lot of PHP calcluation and would just bog down your server. Stop being lazy and just do the ■■■■ HTML!”

So, is this project a good idea, or bad idea?