Link in text typed.js

How to set a link in a typed.jsscript? I need to contact me to contact the contact page.

    <script src="js/typed.js"></script>
    <script>
      $(function(){
          $(".element").typed({
            strings: ["Welcome to my Website.", "Random text... Contact me"],
            typeSpeed: 0
          });
      });
    </script>

 **HTML**

<div class="col-md-12 col-xs-12">
    <h1 class="element"></h1>
 </div>
+4
source share
1 answer

Use the callback option.

Example:

$(function() {
  $('#awesome').typed({
    strings: ["Welcome to my Website.", "Random text... Contact me"],
    typeSpeed: 0,
    callback: function() {
      $('#awesome').html('<a href="#">' + $('#awesome').html() + '</a>')
    }
  });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://raw.githubusercontent.com/mattboldt/typed.js/master/js/typed.js"></script>

<div class="col-md-12 col-xs-12">
  <h1 class="element" id="awesome"></h1>
</div>
Run codeHide result
+2
source

All Articles