Graphical user interfaces are important components of today's software. User interfaces often require checking correctness of user interactions. In web applications such checks can be a part of the JavaScript code. User interfaces in web applications can evolve, some elements can be removed and new elements can be added. To check JavaScript code covers all possible incorrect scenarios in user interactions in web application, constraint programming is used. We use the MiniZinc constraint modelling language to model incorrect user behaviour and to convert JavaScript code into a constraint model. Then we perform an equivalence check to find deviations in JavaScript code. The approach was applied to design user interface of an industrial software product.