Site icon Hip-Hop Website Design and Development

Modify the href attribute of <a> tag dynamically in WordPress

Im utilizing Calculated Type Fields plugin for a WordPress web site. I already created the shape I wanted, however now I want so as to add the calculated worth from the shape as a URL parameter dynamically, when the button bellow the shape is clicked.

The web site makes use of Visible Composer and that is the button html:

<a category="nectar-button medium accent-color has-icon regular-button" goal="_blank" href="https://na2.docusign.web/member/PowerFormSigning.aspx?PowerFormId=df6fbf3d-6f5d-4c48-8965-f4fa810099f4&amp;Institutional_Buyer_AnnualPrice=15000"><span>Buy Kuali Prepared</span></a>

I wish to change the “Institutional_Buyer_AnnualPrice=15000” a part of the URL to be added/modified dynamically, in accordance with what’s the worth within the subject. And that is my present JavaScript code:

(operate($) {
    doc.getElementsByClassName("nectar-button").onclick = operate() {
        var hyperlink = doc.getElementsByClassName("nectar-button");
        var worth = $('#fieldname9_1').val();
        hyperlink.setAttribute('href','https://na2.docusign.web/member/PowerFormSigning.aspx?PowerFormId=df6fbf3d-6f5d-4c48-8965-f4fa810099f4&Institutional_Buyer_AnnualPrice=' + worth);
         return false;
    }
})(jQuery);

Right here is the hyperlink of the web page: https://www.kuali.co/merchandise/kuali-ready-online-purchasing/

I`ve already tried the options of like 3-4 questions on the identical subject I discovered on Stackoverflow, however none of them works for me, thats why I wrote the query to wordpress.stackexchange.com

p.s. Please ignore the truth that making the js code work will have an effect on all of the buttons created with Visible Composer for now.