3 ms·
jQuery's $.text/html() set the text of all matched nodes, not just the first one. I can use key-value object to assign multiple css property, and it can set th
by joesb 11y ago
jQuery's $.text/html() set the text of all matched nodes, not just the first one.
I can use key-value object to assign multiple css property, and it can set the style on all matched nodes.
If there are no matched elements, Bling's $()[0].xxx = value" will raise exception.
- izolate 11y agoThat's the thing, Bling.js also makes it easy to set the text/css on all nodes: $('.foo').forEach(el => el.textContent = 'bar') $('.foo').forEach(el => el.style.top = '0px')