I added 'scriptString' context and it worked fine.< button class ="tablinks" onclick="openSection(event, ${tabs.id @CONTEXT = 'scriptString'}-section)" > When I add @CONTEXT = 'text' , it prints html on page. Thanks for guiding me.
@Manjunath_K, my model class is SlingHttpServletRequest adaptable, when I pass @ index = 2 it works, but when I pass imgList.index it does not take dynamic value. It always gives 0 when I make it as int, null when it is String