How to solve the syntax conflict between velocity and jquery of the same statement in vm file?

for example, my second if judgment in the vm file is whether there is an element containing the id. The first $represents the id pickup of the jquery, and the latter represents the variable attribute in the velocity. How to resolve this conflict so that the two $have different meanings? The
code is as follows:

 -sharpforeach($role in $roleList)
        -sharpforeach($r in $!vo.roles)
                -sharpif($!role.id == $!r.id)
                <input type="checkbox"  id="role_$role.id" lay-filter="role" value="$role.id" title="$role.title" checked/>
                -sharpend
        -sharpend

             -sharpif($("-sharprole_$role.id")                                      
                      <input type="checkbox" name="roles[$role.id].id" id="role_$role.id" lay-filter="role" value="$role.id" title="$role.title"/>
             -sharpend            
 -sharpend
Mar.16,2021
If there is any conflict with

, you can go directly to the global full name of jQuery, that is, change the original $('- sharpxxxx') to jQuery ('- sharpxxxx') this form ~

.
Menu