Is it possible to access HTML values or JS variables from Hugo templates?

I’m trying to find a way to pick up values set by <button> or <select>-<option> tags (or JS variables generated from the values) and use them inside Hugo template code. The purpose would be to use such values as a MATCH value for where function.

Is it possible? I’d appreciate your help.

Hugo is a static site generator. So your HTML gets generated before your JS ever fires. So you can pass values to JS from your templates, but not the other way around.

1 Like

@zwbetz, thanks for the reply.

I had a hunch that this would be a silly question, but needed confirmation. :slight_smile:

Not a silly question IMO. Glad you asked :slight_smile: