How to pass data from eex template to socket.js file

I have chat message app where each chat message has view reply button and message id as argument , I just want to pass that value to socket js file so that from there I can send event to backend

<button id="view_reply" onclick="view_reply(${msg.stamps})" style="width:auto;">view reply</button>