In additional html5 attributes panel the key side does not seem to accept underscore

I used data-mykey_1 as key, with a value ‘abcd’ . But it was showing undefined only.
It took me some time to figure out , and then I removed the underscore to data-mykey1, to make it work. I am not sure if it’s an issue or intentional though. :slight_smile:

Underscores are ok…

  • The name of a custom data attribute in HTML begins with data- . It must contain only letters, numbers and the following characters: dash ( - ), dot ( . ), colon ( : ), underscore ( _ ) – but NOT any ASCII capital letters ( A to Z ).

And works fine my end

59

	let someElement_ = hypeDocument.getElementById('someElement')
	
	console.log(someElement_.dataset.mykey_1);
1 Like