As mentioned Rafal Borowiec to comment block of HTML code you should use
<!--/*something to comment*/--> construction (see documentation).
Also it is possible to comment/remove your javascript code using thymeleaf with
/*[- something to comment -]*/ construction (see documentation). So you can annotate your js code without leaking any information
/*[-
*
* Some information about function.
*
* -]*/
function someFunction() {
console.log('Hello world');
}