Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Very Simple JavaScript Question

SpaceGirl wrote:

> Toby Inkster wrote:
>> Roy Schestowitz wrote:
>> 
>> 
>>>Let us say I have a JavaScript function called get_one() which returns a
>>>one. I am not entirely sure if the returned value can be accessed only by
>>>another function. Is there a way of doing something like the following?
>>>
>>><font size=get_one()>Hello World</font>
>> 
>> 
>> <body onload="document.getElementById('foo').size=get_one();">
>> <font id="foo">Hello World</font>
>> </body>
>> 
>> ??
>> 
> 
> Maybe...:
> 
> <script type="text/javascript>
> function get_one() {
>   x = 1;
>   return x;
> }
> </script>
> 
> <body onload="document.getElementById('foo').style.fontsize=get_one();">
> <div id="foo">Hello World</div>
> </body>

Thanks guys!

I have already done this in PHP (had to learn it as well to get it done)
because I imagined it would be impossible with _simple_ JavaScript.

Took longer, but at least I learned something new...


Roy

-- 
Roy Schestowitz
http://schestowitz.com

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index