JSFiddle - React, Tailwind, and code Playground
HTML
<ol>
<li>Jaws</li>
<li>The Lord of the Rings</li>
</ol>
JavaScript
function getYear(title)
{
$.ajax({
url: "http://www.imdbapi.com/?t=" + title,
dataType: 'jsonp',
success: function(data){
var year = data.Year;
}
});
}
$( "li" ).each(function() {
var text = $( this ).text();
getYear(text);
$(this).append(" ("+year+")");
});