HTML 5 introduced support for a canvas element that can be programmatically drawn on. The really nice thing is that it is very similar to drawing using Processing (in fact, most of the core of p5.js uses the canvas element).
Example: Canvas with a "draw" loop (Uses requestAnimationFrame)
Example: Canvas with "draw" loop and mouse interaction
Reference: W3 Schools - HTML5 Canvas and W3 Schools - HTML Canvas Reference
Tutorial: Mozilla Developer Network - Canvas Tutorial
Examples: 21 Ridiculously Impressive HTML5 Canvas Experiments