JavaScript Puzzler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So I've got the following code in 2 flavors:

Version A:
<textarea name="locationinfo" id="locationinfo" onFocus="if  
((this.value == 'Some stuff\nGoes here.') || (this.value == 'Some  
stuff\rGoes here.')) {this.value=''; this.onfocus=null;}">Some stuff
Goes here.</textarea>

Version B:
<textarea name="locationinfo" id="locationinfo" onFocus="if  
((this.value == 'Some stuff\nGoes here.') || ('Some stuff\rGoes  
here.')) {this.value=''; this.onfocus=null;}">Some stuff
Goes here.</textarea>

This was all an attempt to get it to do what I want cross-browser.

Version A doesn't work in IE. Version B does. And it's all because of  
that second condition in the if() statement. Could somebody explain  
to me why that is, because I got it to work by complete accident and  
it makes no logical sense. Oh, wait, it's IE, of COURSE it doesn't  
make any logical sense!
--
Joe



[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux