5 ms·
What do you use instead of these constructs?
by pm 6y ago
What do you use instead of these constructs?
- austincheney 6y agoInstead of this I use explicitly named variables and functions. Instead of addEventListener I assign event handlers directly to the event property of the DOM: button.onclick = whatever. This forces simplicity and cleaner code management because only one function can be assigned to any given property. Instead of querySelectors I use other standard DOM methods.
- robertakarobin 6y agoOther standard DOM methods like what? getElementById and getElementsByClassName?
- Valord 6y agoI also want to know this.
- austincheney 6y agoTry this for a starter guide: https://prettydiff.com/2/guide/unrelated_dom.xhtml https://prettydiff.com/2/guide/unrelated_dom.xhtml For a practical example try this: https://github.com/prettydiff/semanticText https://github.com/prettydiff/semanticText
- austincheney 6y agoTry this for a starter guide: https://prettydiff.com/2/guide/unrelated_dom.xhtml https://prettydiff.com/2/guide/unrelated_dom.xhtml For a practical example try this: https://github.com/prettydiff/semanticText https://github.com/prettydiff/semanticText
- deleted 6y ago[deleted]