1. HTML Input Element
1.1 Placeholder
Placeholder is the text that appears in the HTML
input
element when no value is set. We can specify it using the HTML attribute placeholder
.HTML
2. JavaScript Built-in Functions
2.1 alert()
The
alert()
function displays an alert box with a specified message and an OK button.JAVASCRIPT
3. DOM Properties
3.1 Checked
The
checked
property sets or returns the checked status of an HTML checkbox input
element as a boolean value.JAVASCRIPT
4. DOM Manipulations
4.1 The removeChild() Method
The
removeChild()
method removes an HTML child element of the specified HTML parent element from the DOM and returns the removed HTML child element.JAVASCRIPT
4.2 The classList.toggle() Method
The
classList.toggle()
method is used to toggle between adding and removing a class name from an HTML element.JAVASCRIPT
We can replace
classList.add()
and classList.remove()
methods with classList.toggle()
method.Try out adding the placeholder to the HTML input elements, deleting the HTML child elements, adding alerts and toggling the class names in the below Code Playground.