<div id="info-leftside">
<div class="label-container" id="name-label"><p class="info-field-label">name</p><p class="error">error</p></div>
<input type="text" name="name" id="name" class="field"/>
<div class="label-container" id="email-label"><p class="info-field-label">email</p></div>
<input type="text" name="email" id="email" class="field"/>
<div class="label-container" id="phone-label"><p class="info-field-label">phone</p><p class="error">error</p></div>
<input type="text" name="phone" id="phone" class="field"/>
<div class="label-container" id="address1-label"><p class="info-field-label">address (line 1)</p></div>
<input type="text" name="address1" id="address1" class="field"/>
<div class="label-container" id="address2-label"><p class="info-field-label">address (line 2)</p></div>
<input type="text" name="address2" id="address2" class="field"/>
<div class="label-container" id="city-label"><p class="info-field-label">city</p></div>
<input type="text" name="city" id="city" class="field"/>
</div>
删除包含“错误”类的 p 标签的最有效方法是什么?我应该在类标签容器上使用 hasClass 吗?但是,如果为真,我该如何删除?