I’ve implemented a simple verlet-integration based 2D cloth simulation in Javascript here. This code is written in standard Javascript and uses the Three.js library for rendering through WebGL / Canvas through any modern browser. This was done as a quick debugging project as I couldn’t get an equivalent high-performance C++ implementation to work. As always, feel free to fork and modify the code to do whatever you want: license is free-for-all.
If you don’t want to Git-clone it on your computer, feel free to run it here online. (Not interactive; feel free to fork here!)