如何在不删除现有值(wordpress)的情况下在 class 中插入更多值?

How to insert more value in class without deleting existing value (wordpress)?

我需要将 'wsqmylogin' 添加到现有的 href class、
这样 class 可以显示 class="wsqmylogin add-request-quote-button".
我尝试了以下代码,但它删除了现有属性(添加请求引用按钮)。
你能告诉我如何在不删除现有值的情况下插入值吗?

现有代码(由插件创建):

<div class="yith-ywraq-add-to-quote add-to-quote-1389">
    <div class="yith-ywraq-add-button show" style="display:block" data-product_id="1389">
         <a href="#" class="add-request-quote-button button" >Add to quote</a>
    </div>
</div>


我试过了:

jQuery(".yith-ywraq-add-button a").attr({class: "wsqmylogin"});

jQuery(".yith-ywraq-add-button a").prop({class: "wsqmylogin"});


谢谢你。

使用.addClass():

jQuery(".yith-ywraq-add-button a").addClass("wsqmylogin");