Need help with a interactive inventory menu

I need a bit of help with a project i’m working on. I’m new to JS, and HTML, but not lua. I am confused no how would I go about blocking the visibility of certain submenus, for example if the player were under the user.cop > 0, for my database that those buttons and submenu would pop up when they open the screen. And as well whats the easiest way to go about looping through a couch.db table inventory items, and create a button per inventory item the person has. Very complex, but if I can figure it out, the entire system would be great to use with my framework. Any advice or tips will help. Thanks! I am currently using wk_actionmenu, and the variable to check if they are a cop is is_cop > 0. I’m really lost on where to get started. I’m really bad at creating loops, and sorting them into x amount of buttons. Was bad even in Java. Any advice would be appreciated.