1.

Why did we utilize the data- the attribute in HTML and why it is now advised not to use?

Answer»

Generally, Data-* attributes of HTML are utilized to accumulate the CUSTOM data, which is private to the web application or PAGE. This custom data is for personalizing the JavaScript of the user as per the user action on the web page.

These days, Data-*attributes are not advised to utilize as the user can change the attribute easily just by utilizing the browser INSPECT console.

Example:



Discussion

No Comment Found