How to select the existing interaction by JavaScript

Hi experts,

 

Does anybody know how to select the existing interaction by JavaScript?

 

What I am trying to do is that

 

1. Click duplicate interaction button

2. Swith the view from the source to the duplicated interaction.

 

I would like to know how to make it realize 2. by JavaScript.

 

Thanks.