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
Post a Comment