Skip to content

Instantly share code, notes, and snippets.

@addieljuarez
Created September 27, 2014 23:14
Show Gist options
  • Select an option

  • Save addieljuarez/4d08ccfbcb180ccdc9e5 to your computer and use it in GitHub Desktop.

Select an option

Save addieljuarez/4d08ccfbcb180ccdc9e5 to your computer and use it in GitHub Desktop.
index curso
<!DOCTYPE html>
<html>
<body>
<h1>10 +</h1>
<input id="input" />
<button id="boton">click</button>
<script>
var fijo = 10;
var inserta = document.getElementById('input');
var boton = document.getElementById('boton');
// boton.addEventListener('click', function(){
// if (10 === '10') {
// alert('si');
// }else{
// alert('no');
// }
// });
// funcion autoejecutable
// (function test1(){
// alert('prueba');
// })();
//mandar llamar una function
function test2(){
var suma2 = 5+5;
alert(suma2);
}
// boton.addEventListener('click', function(){
// test2();
// });
// boton.addEventListener('click', test2);
//argumentos
function test3(n1, n2){
var suma3 = n1 + n2;
alert(suma3);
}
// boton.addEventListener('click', function(){
// test3(4, 7);
// });
function test4(){
var uno = 50;
var dos = 30;
var suma4 = uno + dos;
return suma4;
}
alert(test4());
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment