Skip to content

Instantly share code, notes, and snippets.

@byron-perez
byron-perez / dom_ejerc.js
Created July 6, 2017 17:55
ejercicio06072017
nextNode = function(node) {
//...Code goes here to walk to the next node...
if(node.childNodes.length != 0)
{
return node.firstChild;
}
else if(node.childNodes.length == 0 && node.nextSibling != null)
{
return node.nextSibling;
@byron-perez
byron-perez / ejer.html
Created July 6, 2017 04:07
ejercicios julio 05 2017
<!DOCTYPE html>
<html>
<head>
<title> ejercicio</title>
</head>
<body>
<span id="stars">
<img id="1" src="hola/chistosas.jpg" onclick="cambiar();">
<img src="hola/chistosas.jpg">
<img src="hola/chistosas.jpg">
@byron-perez
byron-perez / gist:345fd78c4881e7160950dcc2f85db97c
Created June 23, 2017 05:03
version recursiva de algoritmos
<script>
function factorialRecursivo(n){
var x = parseInt(n);
if(x == 0) return 1;
return x * factorialRecursivo(x - 1);
}
<script>
function factorialIter(n){
var a = 1;
var x = parseInt(n);
for(m = x; m > 0; m--)
{
a = a * m;
}
for(i = 1; i <= 100; i++){
if((i%3 == 0) && (i%5 != 0)){
console.log("Benito");
}
else if((i%5 == 0) && (i%3 != 0)){
console.log("Campeon");
}
else if((i%5 == 0) && (i%3 == 0)){
console.log("Benito Campeon");
}
<!DOCTYPE html>
<html>
<head>
<title>Bio</title>
<STYLE>
H1 { font-size: 400%; margin-bottom: 0ex; margin-top: 1.5ex; padding-left: 0.21em;
color: #440099; text-align: center; }
/*border-bottom: thick solid #6600cc; }*/
TH { text-align: left; vertical-align: top; padding-right: 1em; }