One of such ways is managed by p2.js, which is gaining popularity among HTML5 game engines.
You can see p2.js in action in the post easy and fast HTML5 physics with Panda.js and p2.js physics library, and today we are creating the same thing, the classic “create a body, skin a body, click a body, remove a body” example.
Play with it:
Click on an empty spot to create a crate, or on an existing crate to destroy it.
And this is the source code, I would recommend to read create web and mobile HTML5 games with Phaser framework and create an HTML5 game like Space is Key with a lot of room for customization if you aren’t used to the framework.
And obviously you can download the source code with all required libraries. Next time, a complete Totem destroyer prototype.