Advertisement
JVFabia

login

Oct 14th, 2020
759
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function saludar() {
  2.     var nombre =  document.getElementById("user").value;
  3.     console.log("nombre " + nombre);
  4.     // agregar HTML al componente
  5.     document.getElementById("mensaje").innerHTML = " Primer mensaje javascript para nuestro usuario  " + nombre;
  6. }
  7.  
  8. function validar(){
  9.     var usuario = document.getElementById("user").value;
  10.     var pass = document.getElementById("password").value;
  11.     var mensaje = document.getElementById("mensaje");
  12.  
  13.     if (usuario == "admin" && pass == "123456"){
  14.         mensaje.innerHTML="Datos Correctos"
  15.     }else{
  16.         mensaje.innerHTML="Datos Incorrectos"
  17.     }
  18.  
  19. }
  20.  
  21. function geo() {
  22.     if (navigator.geolocation){
  23.         navigator.geolocation.getCurrentPosition(function(posicion){
  24.             console.log("latitud: " );
  25.             console.log("longitud: " + posicion.coords.longitude);
  26.         })
  27.     }else{
  28.         console.log("Su navegador no soporta geolocalizacion")
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement