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.
我有一个元素,<span id="userName.errors" class="errors">Enter Your User Name </span>我想使用 jquery 删除文本“输入您的用户名”或属于“错误”类的任何元素
<span id="userName.errors" class="errors">Enter Your User Name </span>
使用text方法:
text
$(".errors").text("New text here");
这针对具有“错误”类的所有元素。