JSFiddle - React, Tailwind, and code Playground
by drublic
HTML
<p>Testing offset() in jQuery with name-Attribute-Selector</p>
<p><a href="#" name="some-value">sdf</a></p>
<p id="offset"></p>
CSS
p { margin: 10px 0; }
JavaScript
$( function() {
var _target = "some-value";
$('#offset').text( $('a[name="' + _target + '"]').offset().top + 'px' );
});