

[Dart] Access HTML Data Attribute
source link: http://siongui.github.io/2015/03/01/dart-access-html-data-attribute/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

[Dart] Access HTML Data Attribute
March 01, 2015
Explain by example, if you have following element in HTML:
<div id="myDiv" data-my-demo-value="value"></div>
Access the value by dataset property:
var value = querySelector("#myDiv").dataset["myDemoValue"];
References:
[1]HTML Global data-* Attributes - W3Schools
[2]Getting HTML5 data-* attribute with Dart - Stack Overflow
[3]dataset - dart:html.Element API Docs
[4]Google search : HTML Data Attribute
[5][Golang] GopherJS DOM Example - Access HTML Data Attribute
Author: Siong-Ui Te ∈ Category: Dart
Recommend
-
50
Home Programming >Front end >Javascript HTML attribute 和 DOM property 的区别 文章目录 ...
-
6
aria-labelledby attribute Related Articles ...
-
13
Perfecting the password field with the HTML passwordrules attribute “passwordrules” is a new attribute on an HTML input tag that allows you to programmatically describe your...
-
14
-
3
Using the HTML img lazy attribute and link preload image to improve page performance Two things that we can easily do improve to improve the image performance on our web pages:1. lazy load the images:
-
8
The HTML A Tag Attribute and Its Importance for SEOErika VaragouliMay 19, 20216 min readWhat is an HTML A tag (anchor tag)?...
-
11
Improve Article HTML | coords AttributeLast Updated : 01 Jul, 2021The HTML coords Attribute is used to specify the coordinate of an area in an image-map....
-
19
How to select the item in Protractor by the html attribute when the value contains advertisements Struggling with how to se...
-
9
Source Code If you have following element in HTML: <div id="foo" data-my-demo-value="Hey"></div> Access the value by Dataset() function, which returns map[string]string:...
-
5
Access HTML data-* attributes of elements in Go/GopherJS. Data attribute of a element allows you to store and retrieve data from the specific element. For example, you may stor...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK