I am really curious. I'm not sure what's the difference between these two codes. I am very curious as a beginner in JavaScript I would appreciate it if you kindly let me know.
$('#url' + nationId).on('click', function(){
window.open(url);
})
document.getElementById('url' + nationId).setAttribute('onclick', "window.open(" + "'"+ url + "'" + ")");