Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
HTML5 data-* attribute type casting strings and numbers
For data-attribute typecasting of Numbers and String, use −
[...document.querySelectorAll("a")].forEach(a =>
console.log("type: %s, value: %o", typeof a.dataset.value, a.dataset.value)
);
The above is for the following data-attributes −
<a data-value = "6.0">6.0</a> <a data-value = "6.5">6.5</a>
Advertisements
