FunHideThe FunHide takes the element and hide, show or toggle
MethodDescriptionparameters
hide()
To hide an element`selector:str`
show()
To show a hidden element`selector:str`
toggle()
Toggle between hiding and showing an element`selector:str`
SelectorExplanationExample
Element SelectorSelects elements based on their tag name.div
ID SelectorSelects an element based on its unique ID attribute.#myElement
Class SelectorSelects elements based on their class name..myClass
Attribute SelectorSelects elements based on their attribute values.[type="submit"]
Descendant SelectorSelects elements that are descendants of another element.div p
Child SelectorSelects elements that are direct children of another element.ul > li
Adjacent Sibling SelectorSelects an element that is the next sibling of another element.h2 + p
Pseudo-class SelectorSelects elements based on a certain state or condition.:hover
#
Showing an element
The show() is used to show a hiddent element.
React / Next.js Show Source Code
#
Hide
The hide() is used to hide an element
React / Next.js Show Source Code
Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquid, at ex, similique voluptas dolorem laboriosam assumenda ipsum labore magni quia quae mollitia minima atque debitis, quis pariatur nesciunt odio facilis.
#
Toggle Show & Hide
The toggle() is used to toggle between showing and hiding an element
React / Next.js Show Source Code
Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquid, at ex, similique voluptas dolorem laboriosam assumenda ipsum labore magni quia quae mollitia minima atque debitis, quis pariatur nesciunt odio facilis.