3 ms·
For this specific example, I would use event listener to sync the content. All done manually in DOM, no shortcut, some codes duplicated. I think that's what SPA
by richajak 7y ago
For this specific example, I would use event listener to sync the content. All done manually in DOM, no shortcut, some codes duplicated. I think that's what SPA frameworks and its components try to promote, single point of update.
Personally, I like the vannila JS approach, a bit tedious, but I know what I will get.