How to pass js value in setuserid

How to pass the javascript variable as value in setUserId method?