Re: Changing text

by Jim Coffield <coffield(at)cet.edu>

 Date:  Tue, 7 Nov 2000 10:56:06 -0500
 To:  John Starkey <jstarkey(at)advancecreations.com>
 Cc:  hwg-languages(at)hwg.org
 References: 
  todo: View Thread, Original
try the following:


function togLit()
{
    if (a==0 || a==1)
    {
        name.outerHTML="<font size=+1>HELLLLP</font>";
        a=2;
    }
    else
    {
        name.outerHTML="<font size=+2>HELLLLP</font>";
        a=1;
    }
}

>ooops sorry. That was just a typo in this message.
>
>On Tue, 7 Nov 2000, Jeff Adelsberger wrote:
>
>> instead of:
>>   if (a==0 || a=1)
>>
>> try:
>>   if (a==0 || a==1)
>>
>>
>> At 23:51 -0700 11/6/00, John Starkey wrote:
>> >I've been fighting this for two hours. Hep me, hep me???
>> >
>> >I'm trying to toggle a line of text between +1 and +2 using JS.
>> >
>> >function togLit()
>> >{
>> >    if (a==0 || a=1)
>> >    {
>> >        name.outerHTML="<font size=+1>HELLLLP</font>";
>> >        a=1;
>> >    }
>> >    else
>> >    {
>> >        name.outerHTML="<font size=+2>HELLLLP</font>";
>> >        a=2;
>> >    }
>> >}
>> >
>> >It's actually about 80 lines of code total, but well....
>> >
>> >Anyway. The second time around it won't change the outerHTML. Is there a
>> >better way to do this? It seems that name.outerHTML!="name.outerHTML" once
>> >you've used it. Does it become something else? Like mod.name.outerHTML or
>> >something, in JS's eyes.
>> >
>> >Thanks,
>> >
>> >John
>>
>> ----------------------------------------
>>                    Jeff Adelsberger
>>                       Programmer
>>                   Dynamic Diagrams
>>                        Baltimore
>>       phone:            410.694.4149
>>       email:    jade(at)dynamicdiagrams.com
>> -----------------------------------------
>>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA