element.setAttribute('onclick', ...) ???
See original GitHub issueHello, In the 0.5.x of tags version, for event handling(eg. onclick),Through`else if (name[0] === “o” && name[1] === “n”) { var event = name.substr(2) element.removeEventListener(event, oldValue) element.addEventListener(event, value)
}` to deal with, now through `element.setAttribute` to deal with,In the brower, compiled code such as :
This logic is exposed to the HTML on whether there is any safety problems?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Why does an onclick property set with setAttribute fail to work ...
Turns out to get IE to run an onclick on a dynamically generated element, we can't use setAttribute. Instead, we need to set...
Read more >setAttribute('onclick', 'alert(this.id)') works for existing element ...
I can - using setAttribute - add an event handler, for instance onclick, to elements existing in the HTML source but if I...
Read more >Setting and changing the onclick attribute with Javascript
If you need to change or assign a value to the onclick attribute of a DOM element, you have two options; you can...
Read more >Introduction to Browser Events | W3docs JavaScript Tutorial
If you assign two event handlers for that, the DOM property will overwrite the existing one, like this: w3docs logo Javascript setAttribute onclick...
Read more >HTML onclick Event Attribute - W3Schools
Definition and Usage. The onclick attribute fires on a mouse click on the element. Browser Support. Event Attribute.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
just set all
on*
attrs as properties:el.onclick = ....
Yes, this is probably it, thanks @leeoniya 👌👍.