Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function saludar() {
- var nombre = document.getElementById("user").value;
- console.log("nombre " + nombre);
- // agregar HTML al componente
- document.getElementById("mensaje").innerHTML = " Primer mensaje javascript para nuestro usuario " + nombre;
- }
- function validar(){
- var usuario = document.getElementById("user").value;
- var pass = document.getElementById("password").value;
- var mensaje = document.getElementById("mensaje");
- if (usuario == "admin" && pass == "123456"){
- mensaje.innerHTML="Datos Correctos"
- }else{
- mensaje.innerHTML="Datos Incorrectos"
- }
- }
- function geo() {
- if (navigator.geolocation){
- navigator.geolocation.getCurrentPosition(function(posicion){
- console.log("latitud: " );
- console.log("longitud: " + posicion.coords.longitude);
- })
- }else{
- console.log("Su navegador no soporta geolocalizacion")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement