HTML use in arduino

HI I have the following want to use in Arduino to turn led on and off , how do i achieve that so the toggle switch (checkbox) controls the LED on and off accordingly.

and what is the easy way to format it for use.

<!DOCTYPE html>
<html>
<head>
<title>Smart LED</title>
</head>
<body>
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="onoffswitch1" unchecked="">
  <label class="onoffswitch-label" for="onoffswitch1">
	<div class="onoffswitch-inner"></div>
	<div class="onoffswitch-switch"></div>
  </label>
  </div>
<style>
.onoffswitch {
    position: relative; width: 90px;
    -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
}
.onoffswitch-checkbox {
    display: none;
}
.onoffswitch-label {
    display: block; overflow: hidden; cursor: pointer;
    border: 2px solid #999999; border-radius: 20px;
}
.onoffswitch-inner {
    width: 200%; margin-left: -100%;
    -moz-transition: margin 0.3s ease-in 0s; -webkit-transition: margin 0.3s ease-in 0s;
    -o-transition: margin 0.3s ease-in 0s; transition: margin 0.3s ease-in 0s;
}
.onoffswitch-inner:before, .onoffswitch-inner:after {
    float: left; width: 50%; height: 30px; padding: 0; line-height: 30px;
    font-size: 14px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;
    -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
.onoffswitch-inner:before {
    content: "ON";
    padding-left: 10px;
    background-color: #2FCCFF; color: #FFFFFF;
}
.onoffswitch-inner:after {
    content: "OFF";
    padding-right: 10px;
    background-color: #EEEEEE; color: #999999;
    text-align: right;
}
.onoffswitch-switch {
    width: 18px; margin: 6px;
    background: #FFFFFF;
    border: 2px solid #999999; border-radius: 20px;
    position: absolute; top: 0; bottom: 0; right: 56px;
    -moz-transition: all 0.3s ease-in 0s; -webkit-transition: all 0.3s ease-in 0s;
    -o-transition: all 0.3s ease-in 0s; transition: all 0.3s ease-in 0s; 
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
    margin-left: 0;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
    right: 0px; 
}
</style>
</body>
</html>

Allocate a pin to the led. Then use Adafruit buttons on_btn & off_btn. Very easy to use.

on_btn.initButton(&tft,  230, 15, 50, 30, CYAN, GREEN, BLACK, "ON", 1);
  off_btn.initButton(&tft, 285, 15, 50, 30, CYAN, RED, BLACK, "OFF", 1);
  on_btn.drawButton(false);
  off_btn.drawButton(false);

@fnb111
Where does OP mention tft screens?

@destiny2008
It's not 100% clear what your problem is. Did you implement a web server on the Arduino?

@destiny2008
It's not 100% clear what your problem is. Did you implement a web server on the Arduino?

the web server is initiated on esp8266 Arduino yes..

You can't "use" HTML on the Arduino. You can make the Arduino-as-server send data that the receiving ends treats as HTML. But, it's just text as far as the Arduino is concerned.

When you send that text to a web browser, and it renders a checkbox, clicking on the checkbox will cause the browser to make a GET request.

Your server needs to examine the GET request, and react accordingly.

PaulS:
You can't "use" HTML on the Arduino. You can make the Arduino-as-server send data that the receiving ends treats as HTML. But, it's just text as far as the Arduino is concerned.

When you send that text to a web browser, and it renders a checkbox, clicking on the checkbox will cause the browser to make a GET request.

Your server needs to examine the GET request, and react accordingly.

this i achieve how , any example ?