javascript - Change the link text -


hi guys want <a href="template.html">redirect</a> change text of link suppose click on link change link text confirm redirect & not redirect in template.html @ first time & wait second click & in second time when click on again redirect in template.html.

you can use one() fire event handler once

// bind click event handler fire once  $('#btn').one('click', function(e) {    // prevent default click event action    e.preventdefault();    // change tag text    $(this).text('confirm redirect')  })
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>  <a id="btn" href="template.html">redirect</a>


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -