dimanche 5 novembre 2017

JS/JQUERY - Creating Div Class inside script

I found this code : Its working fine !

<a href="http://ift.tt/2zdS0CF">
  <script type="text/javascript">
    var phrases = [
      'basha',
      'hameed',
      'hey'
    ];
    var scripts = document.getElementsByTagName('script');
    var this_script = scripts[scripts.length - 1];
    this_script.parentNode.replaceChild(document.createTextNode(phrases[Math.floor(Math.random() * phrases.length)]), this_script);
  </script>

Small info ( Am building small job portals website. All my jobs are fixed now i want them all to randomly rearrange everytime clicking in link.)

My question is How to add div class on this code ? thanks in advance




Aucun commentaire:

Enregistrer un commentaire