bueno estoy creando un framework en javascript y tengo este codigo
Código Javascript
:
Ver original(function(window) {
var framework = (function(){
var metodos = {
get: function(id){
return framework.extend(document.getElementById(id), framework);
},
extend: function(el, opt){
for (var name in opt) el[name] = opt[name];
return el;
},
html: function(val){
if (!val) return this.innerHTML;
this.innerHTML = val;
return this;
},
val: function(val){
if (!val) return this.value;
this.value = val;
},
version: function(){
ver = '0.1 beta'
return ver;
}
};
return {
extend: function(el, opt){
for (var name in opt) el[name] = opt[name];
return el;
},
get: function(id){
return framework.extend(document.getElementById(id), metodos);
}
};
}(framework));
window.$ = framework.get;
}(window));
el problema es que cuando intento hacer esto en las etiquetas script
Código Javascript
:
Ver original<script>
alert($('logo3').val('alan'))
</script>
no funciona marca esto:
Break on Error
el is null
pero si lo pongo en el evento onclick de un boton por ejemplo si funciona
P.D: perdon si no puse imagenes pero no pude lo mostraba como texto
testa es la url de la imagen http://img101.imageshack.us/img101/4075/ejemplog.jpg