-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprueba_componentes.html
75 lines (57 loc) · 2.3 KB
/
prueba_componentes.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<html>
<head>
<link type="text/css" rel="stylesheet" href="./bower_components/bootstrap/dist/css/bootstrap.min.css" />
<script type="text/javascript" src="./bower_components/jquery/dist/jquery.js"></script
<script type="text/javascript" src="./bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
</head>
<body>
<script type="text/javascript">
function textoKeyPressed(miObj,evento){
console.log(miObj+":"+evento);
};
function textoBlurred(miObj,evento){
console.log(miObj+":"+evento);
miFade(miObj);
};
function miFade(miObj){
var divDisplay = document.createElement('div');
divDisplay.className="modal fade";
var mod=document.createElement('div');
mod.className="modal-dialog";
var modCont=document.createElement('div');
modCont.className="modal-content";
var modText=document.createElement('div');
modText.className="modal-title";
var modTitle=document.createTextNode("Ventana modal");
modText.appendChild(modTitle);
modCont.appendChild(modText);
mod.appendChild(modCont);
divDisplay.appendChild(mod);
var miContenido=document.getElementById("contenido");
miContenido.appendChild(divDisplay);
};
function crea(){
var texto=document.createElement("input");
texto.className="clase1";
texto.type="text";
todo="un texto";
texto.addEventListener('keypress', textoKeyPressed.bind(this, todo));
texto.addEventListener('blur', textoBlurred.bind(this, todo));
var divDisplay = document.createElement('div');
divDisplay.className = 'view';
divDisplay.appendChild(texto);
divDisplay.id="vista1"
return divDisplay;
}
function dibuja(){
var miContenido=document.getElementById("contenido");
miContenido.innerHTML='';
miContenido.appendChild(crea());
}
$(document).ready(function() {
dibuja();
});
</script>
<div id="contenido"></div>
</body>
</html>