It's impossible to achieve this just using JQuery, you have to use JSOM to achieve this. You need to create a new column named "Parent" for your list. This is a lookup column and it does look-up to its list.
Below is my script demo for you, it is in the below demo.txt file. And you need to change the list name and column name in the code if necessary.
Test result:
Reference:
https://www.linkedin.com/pulse/display-category-list-tree-view-blog-site-sharepoint-hai-nguyen