-
Hi i am using htmx library on frontend. When i try to add htmx attributes to elements (like hx-get='/' or hx-ext) i get error. how do i add attributes with '-'. dttg.td(dttg.button("DV",_type="button",cls="btn btn-primary btn-sm",hx-ext='ws') SyntaxError: expression cannot contain assignment, perhaps you meant "=="? |
Beta Was this translation helpful? Give feedback.
Answered by
Knio
May 16, 2023
Replies: 1 comment 2 replies
-
You can add attributes like this using a dictionary or the item interface, ie: b = button(**{'hx-get': '/'})
# or
b['hx-ext'] = 'ws' |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
phneoix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can add attributes like this using a dictionary or the item interface, ie: