.val will not create anything if your script can’t do it at higher level (sudo admin or root rights to be able to write on server). Not to mention, this is a nice try but, in the end your app will have serious performance issues trying to code tabs on the fly.
.val in your code will ask for server rights, which in most cases will be refused if not logged in as root or superuser (that means this code will never work in production with guest people on your server).
what is this .val you are talking about that will need all these rights etc. ? I am somehow lost and feel we are talking two different things. Kindly enlighten