hi. i want to shorten getElementById() string at my files.
ive writen this function:
function gebi(el){
document.getElementById(el)
}
and when i try to call an ID, i try to call him like this:
gebi('myID').
but this method doesnt succeed.
can you please assist me to achive that goal?
tnx
NeoSwf
neoswf wrote on 31 jan 2006 in comp.lang.javascript:
> hi. i want to shorten getElementById() string at my files.
> ive writen this function:
[quoted text clipped - 5 lines]
> but this method doesnt succeed.
> can you please assist me to achive that goal?
function gebi(el){
return document.getElementById(el);
}

Signature
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
neoswf - 31 Jan 2006 12:18 GMT
> function gebi(el){
> return document.getElementById(el);
> }
thank you Evertjan.
how can i recive this kind of result:
gebi(el).style.width?
to use this method in different usages like reciving the style object
and etc...
neoswf - 31 Jan 2006 12:22 GMT
> to use this method in different usages like reciving the style object
> and etc...
thank you Evertjan, its working great!
<script>
alert(gebi('shlomi').style.width);
</script>
:)