Demonstration of data-

by kdorff

HTML

<p>top</p>
<span id="url-source" data-url="https://www.google.com/search?q=kittens">Span with data</span>
<p>bottom</p>
<span id="url-destination">NO URL!</span>

JavaScript

// This script is configured withg jQuery 2.4.4 in the
// HEAD of the resultant document.

// no need to specify data- since we are using the .data method
$(document).ready(function() {
	var url = $('#url-source').data('url');   
	console.log(url);
	$('#url-destination').text(url);
});