Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想学习如何替换字符串?我有一个电子邮件地址someone@website.com,我该如何替换@to%和.to±
someone@website.com
@
%
.
±
var replacements = {"@": "%", ".": "±"}; string.replace(/@|\./, function (match) { return replacements[match]; });
我正在尝试制作一个通用的 JavaScript 函数来获取标签中的条目集合。例如:
有清单
<ul class="collection"> <li>First Entry</li> <li>Second Entry</li> <li>Third Ent