top | item 31956048 (no title) gimme_treefiddy | 3 years ago One of the things that I found lacking, was doing like general computing-esque business intelligence tasks in htmx. For example, how would you set src on image tag upon a click. Ended up having to use jquery. discuss order hn newest MonadicSystems|3 years ago You should be able to do this with hyperscript. <img src="my_cat.jpg" alt="My cat" _="on click set @src to 'my_other_cat.jpg'"> mattlondon|3 years ago I am not sure what the benefit of hyperscript would be here? Why not just use JavaScript + htmx? load replies (1) ngcc_hk|3 years ago Any more full example? Interested. load replies (1) recursivedoubts|3 years ago you'd use hyperscript for something client side like that:on click set @src to "https://whatever.com/cat.gif"the htmx approach would be to replace the image tag entirely
MonadicSystems|3 years ago You should be able to do this with hyperscript. <img src="my_cat.jpg" alt="My cat" _="on click set @src to 'my_other_cat.jpg'"> mattlondon|3 years ago I am not sure what the benefit of hyperscript would be here? Why not just use JavaScript + htmx? load replies (1) ngcc_hk|3 years ago Any more full example? Interested. load replies (1)
mattlondon|3 years ago I am not sure what the benefit of hyperscript would be here? Why not just use JavaScript + htmx? load replies (1)
recursivedoubts|3 years ago you'd use hyperscript for something client side like that:on click set @src to "https://whatever.com/cat.gif"the htmx approach would be to replace the image tag entirely
MonadicSystems|3 years ago
mattlondon|3 years ago
ngcc_hk|3 years ago
recursivedoubts|3 years ago
on click set @src to "https://whatever.com/cat.gif"
the htmx approach would be to replace the image tag entirely