Trying to pull text from one field and put it into a button text Trying to pull text from one field and put it into a button text
I have a page that I can use merge fields from a CMS to dynamically adjust content; however, this functionality doesn't work with button text. Therefore, I need to use a normal text field and then take the value from that field and push it to the button text.
I thought this would work, but something it's not working right. Can anyone help me figure out what I am doing wrong?
<div id="ctatext" class="ctabutton">Request Pricing</div>
<input type="submit" value="Get Started" data-wait="Please wait..." id="ctabutton" class="_2-0-yellow-btn-2 request w-button">
<script>
$(document).ready(function () {
let btntext = $('.ctabutton').text();
$('input._2-0-yellow-btn-2 request w-button').val(btntext);
});
</script>
from Stackoverflow
Comments
Post a Comment