The hx-vals attribute allows you to safely add to the parameters that will be submitted with an AJAX request.

The value of this attribute is a list of name-expression values in JSON (JavaScript Object Notation) format.

  <div hx-get="/example" hx-vals='{"myVal": "My Value"}'>Get Some HTML, Including A Value in the Request</div>

Security Considerations