[Solved] Replace text wrapped in a button tag w with Jquery [duplicate]


You need to import jQuery first. Place your code inside a method like .ready or .click that will trigger the event.

jQuery(document).ready(function(){
    jQuery('#load').text(function() {
        jQuery(this).text('MÉG TÖBB MEMORABILIA');
    })

});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>


<div id="memorabilia">
<button class="btn btn-primary" id="load">More Memorabilia</button>
</div>

EDIT:

You can ommit the second line. So the final code will be

jQuery(document).ready(function(){
        jQuery('#load').text('MÉG TÖBB MEMORABILIA');
});

2

solved Replace text wrapped in a button tag w with Jquery [duplicate]