first of all i'm talking about $('selector').data() not $.data()
now when i searched for it i found a lot of issues regarding using it
for example see this answer https://stackoverflow.com/a/8708345/2748984 it says that you can't set data with attr and get it with data (that's 4 years ago) but actually it works now but not as expected
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>
<script>
$(function () {
$('#testDiv').attr('data-someThing',1);
alert($('#testDiv').data('someThing'));//alert undefined
alert($('#testDiv').data('something'));//alert 1
alert($('#testDiv').attr('data-something'));//alert 1
alert($('#testDiv').attr('data-someThing'));//alert 1
});
</script>
</head>
<body>
<div id="testDiv">test div</div>
</body>
</html>
it's only get the lowercase version of the data name
my question is if that's intended or bug i should report to jquery
and if it's intended then why it act like that