Writing out PureScript code for the DOM only really makes sense if you're doing some sort of interesting manipulations on the JS layer. Otherwise, it's pretty tedious and longer than HTML. Thankfully, there's a solution: PursX.
PursX takes its name from JSX and it accomplishes a similar goal: the ability to embed HTML in your document. In the example below, we create the same exact component from the previous article, but in PursX.
Here's what it produces:
Static Pursx (meaning Pursx without any dynamic content) can be activated with the function
In this section, we used PursX to build the same component as the previous section. In the next section, we'll learn how to respond to events.