You can get it using REST query. The code should be:
$( document ).ready(function() {
GetListGuid('Lib1');
});
function GetListGuid(listTitle){
try {
//REST Query to get the List Title
jQuery.ajax(
{
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('"+listTitle+"')?$select=Id",
type: "GET",
async: false,
headers: { "Accept": "application/json;odata=verbose" },
success: function (data, textStatus, xhr) {
alert(data.d.Id);
},
error: function (data, textStatus, xhr) {
console.error("Error.");
}
});
}
catch (ex) {
alert(ex);
}
}
Hope this helps!