1. HTML Input Element
1.1 Checkbox
The HTML
input
element can be used to create a Checkbox. To define a Checkbox, you need to specify the HTML type
attribute with the value checkbox
for an HTML input
element.HTML
1.2 The HTML Label Element
The HTML
label
element defines a Label.HTML
1.2.1 The HTML for Attribute
The HTML
for
attribute associates the HTML label
element with an HTML input
element.HTML
2. DOM Manipulations
2.1 The htmlFor Property
We can use
htmlFor
property to add HTML for
attribute to the HTML label
element.JAVASCRIPT
2.2 The setAttribute() Method
We can use
setAttribute()
method to set any HTML attribute name and its corresponding value. If the attribute already exists, the value is updated. Otherwise, a new attribute is added with the specified name and value.Syntax:
Element.setAttribute(name, value);
JAVASCRIPT
Try out creating the HTML
label
element dynamically in the below Code Playground.3. Loops
Loops allow us to execute a block of code several times.
- for...of Loop
- for...in Loop
- for Loop
- while Loop and many more.
3.1 The for...of Loop
JAVASCRIPT
The HTML Code for creating a Todo Item:
HTML
4. CSS Box Properties
4.1 Border
The CSS
border
property is a shorthand property for:- border-width
- border-style (required)
- border-color
For example,
CSS
Instead of writing the CSS properties
border-style
, border-width
and border-color
individually, we can apply these properties at once with a single CSS property called border
.Syntax:
border: border-width border-style border-color
CSS
To specify the border on one of the four sides of an HTML element, you can use the below CSS properties.
- border-top
- border-bottom
- border-right
- border-left
CSS
If the border is not required, we can apply the
none
as value to the CSS border
property.CSS
For example, if the border property is not required on the top side of an HTML element. You can use,
CSS
Try out applying the different CSS border properties in the below Code Playground.