You can use knockout (http://knockoutjs.com/) to communicate from Slim to items on your webpage.
You can do what you want (replace a text within tags), or make a list that is filled with a json response from Slim.
Don’t try to invent the wheel 
Knockout has good help to start with and is very easy to implement.