Thank you all for your answers and help. With help of Ahmed Zia's comments I found solution to my problem.
As the complete ulul is getting formed dynamically, and the page is unable to find the click event later. So I changed my code like below so that the click event will be registered after the ulul got created and bound to div (tabsContainerDiv_idtabsContainerDiv_id) of a page
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
ExecuteOrDelayUntilScriptLoaded(getItems, "sp.js");
function getItems() {
//Get list items and onSuccess bind to ul
registerEvents();
}
function registerEvents(){
$('#tabsContainerDiv_id').on('click',' ul.tabs li', function(){
// Switch between tabs
});
}
});
</script>
});