You can use the Assertion API and set up acceptance criteria.
However, Gatling isn't a browser and won't run/test your Javascript, so this approach is only realistic when dealing with server side content, such as testing REST APIs. Here's an example.