8 amazing HTML attributes that are so powerful and maybe you haven't heard of them yet
π§΅ππ»
1οΈβ£ Translate
The translate attribute specifies whether the content of an element should be translated or not
You can use it in your brand name so that whenever page translated to other language, your brand name will keep same
2οΈβ£ sandbox
Applies extra restrictions to the content in the frame. The value of the attribute can either be empty to apply all restrictions, or space-separated tokens to lift particular restrictions
sandbox attribute accepts following values
3οΈβ£ Reversed
Reversed attribute simply reverse the numbering of ordered list. Instead to 1, 2, 3... It will be 3, 2, 1
4οΈβ£ Poster
Specifies an image to be shown while the video is downloading, or until the user hits the play button. You can consider it as a thumbnail
5οΈβ£ Pattern
Specifies a regular expression that an <input> element's value is checked against. For example, a password field must contain 8 or more characters
6οΈβ£ Tabindex
The tabindex attribute specifies the tab order of an element (when the "tab" button is used for navigating).
For example, the element with tabindex="1" will be focused when user press the tab first time
useReducer is preferable to useState when you have some complex state.
It accepts three parameter out of which two are mandatory I guess
The first one is reducer function and second one is initial state
useReducer returns two things
- The first one in current state
- The second one is a dispatch function using which you can change your current state by passing action type is dispatch.