I created a JS function that opens modals - it works perfect but I was wondering if the way I am calling that function is a good idea and practice.