# Take actions based on user choice

You can add interactions on your web page based on how a user interacts with
your form.



Let's say, user clicked on "Play video" in a Multi Choice Type
[/article/1029-multi-choice-type] message. Then you can use the JavaScript
method, collectchat.on
[https://developers.collect.chat/#/callbacks?id=collectchatonevent-function] to
be triggered when user makes such a selection.

<script>
var collectchat = window.collectchat || {};
collectchat.ready = function() {
  collectchat.on('message', function(details) {
    console.log('User responded to question', details.question, details.answer);
  });
}
</script>

Here, details.question will have the question that was posed to the user and
details.answer will contain the reply given by the user in the form. You will
have to write your own code to play the video based on the message user
interacted with.



Other possible use-cases are:

 * Redirecting user to a different page of the website
   
   

 * Creating an interactive tutorial to educate your user
   
   

 * Scrolling to a section of the webpage
   
   

Note



You will need the help of a developer to do this.