Last active
December 16, 2015 22:20
-
-
Save emedinaa/5506592 to your computer and use it in GitHub Desktop.
Tipo de Datos Básicos
This file contains hidden or 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> | |
<head> | |
<title></title> | |
<link rel="stylesheet" type="text/css" href="assets/css/style.css"> | |
</head> | |
<body> | |
<div id="div1" class="mydiv" onclick="changeColor(this)"></div> | |
<div id="div2" class="mydiv" onclick="changeColor(this)"></div> | |
<div id="div3" class="mydiv" onclick="changeColor(this)"></div> | |
<button >click</button> | |
<script type="text/javascript"> | |
var div1=document.getElementById('div1'); | |
var div2=document.getElementById('div2'); | |
var div3=document.getElementById('div3'); | |
function change1() | |
{ | |
//div1.style.backgroundColor="#ffff00"; | |
//div2.style.backgroundColor="#ffff00"; | |
//div3.style.backgroundColor="#ffff00"; | |
changeColor(div1); | |
} | |
function change2() | |
{ | |
changeColor(div2); | |
} | |
function change3() | |
{ | |
changeColor(div3); | |
} | |
function changeColor(aux) | |
{ | |
aux.style.backgroundColor="#ffff00"; | |
} | |
</script> | |
</body> | |
</html> |
This file contains hidden or 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> | |
<head> | |
<title>Js para Diseñadores</title> | |
<link rel="stylesheet" type="text/css" href="assets/css/style.css"> | |
</head> | |
<body> | |
<div id="container"></div> | |
<script type="text/javascript" src="js/app.js"></script> | |
<script type="text/javascript"> | |
//iniciar código | |
console.log("init "); | |
var nombre="Eduardo Medina"; //String | |
var x=10;//number | |
var y=-20; | |
var angle=0.5; //var ANGLE=0.5; | |
var status=false;//true//false boolean | |
var arr= new Array(); | |
arr[0]="Lunes"; | |
arr[1]="Martes"; | |
arr[2]="Miercoles"; | |
arr[3]="Jueves"; | |
arr[4]="Viernes"; | |
var myVariableQueRealizaAlgunaAcccion;//UNDEFINED | |
var myVariableChiquita=10; | |
myVariableChiquita="Hola"; | |
//var my Super Variable ="10"; | |
var edad_Nino=10; | |
//var edad_Niño=10; | |
/* var edad:Niño=10; | |
var edad/Niño=10; | |
var edad.Niño=10; | |
var edad;Niño=10; */ | |
/* | |
comentario de | |
más de una linea | |
*/ | |
var obj=new Object(); //{} encapsular | |
obj.edad=25; | |
obj.sexo="F"; | |
obj.dni="40898479"; //E10 | |
console.log("nombre "+nombre ); | |
console.log("x "+x ); | |
console.log("y "+y ); | |
console.log("status "+status ); | |
console.log("angle "+angle ); | |
console.log("myVariableQueRealizaAlgunaAcccion "+myVariableQueRealizaAlgunaAcccion ); | |
console.log("myVariableChiquita "+myVariableChiquita); | |
console.log("obj "+obj +" edad "+obj.edad); | |
</script> | |
</script> | |
</body> | |
</html> |
This file contains hidden or 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> | |
<head> | |
<title>Operadores y Condicionales</title> | |
<link rel="stylesheet" type="text/css" href="assets/css/style.css"> | |
</head> | |
<body> | |
Valor 1 <input type="text" id="txt1"/><br/> | |
Valor 2 <input type="text" id="txt2"/><br/> | |
<button id="btn" onclick="sumar()">Click</button><br/> | |
<img id="img" src="assets/img/img01.jpg" width="100" height="100"> | |
<h2>v1.0</h2> | |
<script type="text/javascript"> | |
var img=document.getElementById('img'); | |
var btn=document.getElementById('btn'); | |
//paso 1 : obtener los valores | |
//paso 2 : realizar operaciones | |
//paso 3 : mostrar resultado | |
var txt1=document.getElementById('txt1'); | |
var txt2=document.getElementById('txt2'); | |
function sumar() | |
{ | |
console.log("click"); | |
///alert("Hola "); | |
//console.log("img "+img); | |
console.log("valor 1 >",txt1.value); | |
console.log("valor 2 >",txt2.value); | |
var op1=parseInt(txt1.value); | |
var op2=parseInt(txt2.value); | |
var suma=op1*op2;//+ - / * % | |
alert("Suma = "+suma); | |
} | |
</script> | |
</body> | |
</html> |
This file contains hidden or 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> | |
<head> | |
<title>Operadores y Condicionales</title> | |
<link rel="stylesheet" type="text/css" href="assets/css/style.css"> | |
</head> | |
<body> | |
Valor 1 <input type="text" id="txt1"/><br/> | |
Valor 2 <input type="text" id="txt2"/><br/> | |
<button id="btn" onclick="sumar()">Click</button><br/> | |
<div id="mydiv"></div> | |
<img id="img" src="assets/img/img01.jpg" width="100" height="100"> | |
<h2>v1.0</h2> | |
<script type="text/javascript"> | |
var img=document.getElementById('img'); | |
var btn=document.getElementById('btn'); | |
var mydiv=document.getElementById('mydiv'); | |
//paso 1 : obtener los valores | |
//paso 2 : realizar operaciones | |
//paso 3 : mostrar resultado | |
var txt1=document.getElementById('txt1'); | |
var txt2=document.getElementById('txt2'); | |
function sumar() | |
{ | |
console.log("click"); | |
///alert("Hola "); | |
//console.log("img "+img); | |
console.log("valor 1 >",txt1.value); | |
console.log("valor 2 >",txt2.value); | |
var op1=parseInt(txt1.value); | |
var op2=parseInt(txt2.value); | |
var suma=op1*op2;//+ - / * % | |
alert("Suma = "+suma); | |
mydiv.style.backgroundColor="#ff00ff"; | |
mydiv.innerHTML="resultado "+suma; | |
//mydiv.innerHTML="<h2></h2>"; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment