You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Normally, nanohtml intercepts the onclick property of its elements, and converts them to JS Event Listeners.
However, when I pass a string containing an HTML element with an onclick attribute through nanohtml/raw, the onclick attribute is passed through to the DOM as is, with no conversion to an Event Handler.
I have a script which parses my app's content for certain terms which should be clickable, and wraps them in a tag. That's why I'm using the raw function. Is it possible to pass raw HTML to nanohtml, but still have nanohtml handle onclicks as it usually does?
The text was updated successfully, but these errors were encountered:
unitof
changed the title
onclick Event Handlers with nanohtml/raw
onclick Event Handlers with nanohtml/raw
Sep 14, 2018
Normally,
nanohtml
intercepts theonclick
property of its elements, and converts them to JS Event Listeners.However, when I pass a string containing an HTML element with an
onclick
attribute throughnanohtml/raw
, theonclick
attribute is passed through to the DOM as is, with no conversion to an Event Handler.I have a script which parses my app's content for certain terms which should be clickable, and wraps them in a tag. That's why I'm using the
raw
function. Is it possible to pass raw HTML tonanohtml
, but still havenanohtml
handleonclick
s as it usually does?The text was updated successfully, but these errors were encountered: