Elements in a function

Posted under » JavaScript on 29 Oct 2018

Sometimes we need to reuse a certain function. You do this by using elements.

If you need to do a single link, you do this. However, you can make this URL flexible using elements

<button onclick="visitPage('2018');">2018</button>

The script.

 function visitPage(year){
        window.location='pastpublications.php?b='+year+'#'+year;
    }

However, most of the time, the elements are at getElementById.

web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS data