JSFiddle - React, Tailwind, and code Playground

by marlanga

HTML

<html>
 
<head>
 
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />
 
<title>Formulario nota nueva</title>
 
</head>
 
<body>
 
<div id="boton"><a id="funcion" href="#">Inicio</a></div> 
 
</body>
</html>

JavaScript

function inicio()
{
  alert("inicio");
  return false;
}
 
function final()
{
  alert("final");
    return false;
}

    
//window.onload=funtion(){
    var enlace=document.getElementById("funcion");
    enlace.inicio=true;

    enlace.onclick=function(){
        if (this.inicio)
        {
            inicio();
            this.innerHTML="Final";
        }
        else
        {
            final();
            this.innerHTML="Inicio";
        }
        this.inicio=!this.inicio;
    };
//}