Last active
June 12, 2020 16:37
-
-
Save legarnica/1aa329e615563ad9cea09d81fe050833 to your computer and use it in GitHub Desktop.
faker-vanillajs-html-example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Facker</title> | |
</head> | |
<body> | |
<h3>Nombre: <span id="nombre"></span></h3> | |
<h3>Email: <span id="email"></span></h3> | |
<h3>Dirección: <span id="direccion"></span></h3> | |
<img id="avatar" alt="ramdom"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Faker/3.1.0/faker.min.js"></script> | |
<script> | |
document.querySelector('#nombre').innerHTML = faker.name.findName() | |
document.querySelector('#email').innerHTML = faker.internet.email() | |
document.querySelector('#direccion').innerHTML = faker.address.streetAddress() | |
document.querySelector('#avatar').setAttribute('src', faker.internet.avatar()) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ejemplo simple de uso de la librería Facker con js y html