Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ESTA METODO FUNCIONA , REALIZA UNA ACCION EN EL DOM AL LLAMARLO
- function mostrar() {
- document.write("<h2>Titulo: "+this.titulo+"</h2>");
- document.write("<h2>Grupo: "+this.grupo+"</h2>");
- document.write("<h2>Fecha: "+this.año+"</h2>"+"<br><br>");
- }
- function cd_musica(titulo,grupo,año) {
- this.titulo = titulo;
- this.grupo = grupo;
- this.año = año;
- this.mostrar = mostrar;
- }
- // NO FUNCIONA DEVUELVE UN VALOR A UNA PROPIEDAD (NO SE LLAMARIA DESDE FUERA DEL OBJ, solo usa la func par coger un valor)
- function getColor() {
- if (!this.disponible) {
- return "red";
- }else{
- if (this.selec) {
- return "green";
- }else{
- if (this.tipo == "mesaM") {
- //return "#a05a2c";
- return "purple";
- }else
- return "#ffd42a";
- }
- }
- }
- function Elemento(tipo,id,disponible,genCod,selec,tag) { //tag es por REFERENCIA o por valor?
- this.tipo = tipo;
- this.id = id;
- this.disponible = disponible;
- this.genCod = genCod;
- this.selec = selec;
- this.changeColor = getColor;
- this.tag = tag;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement