I want to get name string from data-rName into JQuery. Currently, it is showing undefined. This rName should returns Name string but not value.
View
<tr id="row" data-rName="@dr["rName"]" >
Script
$('#DetailsPartial').on('click', '#row', function () {
var rName = $(this).data('rName');
});
$(this)in this context ? Is it the jQuery object for the row ?@dr["rName"]generate?undefinednow. This is string value coming from database.<tr>element does not have aid="row"attribute. You need to show us the code to reproduce your issue. What is the element withid="row"? (and it also suggests you have duplicateidattributes which is invalid html)