...

View Full Version : what does ! mean



andrew1234
03-03-2005, 03:05 PM
in the following i statemen what does the ! mean

thanks

Andrew


if (!document.getElementById('blink').style.color){
document.getElementById('blink').style.color="red"
}

liorean
03-03-2005, 03:13 PM
! is a logical not. If document.getElementById('blink').style.color is false, an empty string, 0, NaN, undefined or null, the logical not will negate it to true. In all other cases, it will negate it to false.

This means that document.getElementById('blink').style.color will be given a value 'red' if it doesn't already have a value.

andrew1234
03-05-2005, 01:51 PM
thanks for the help..

Andrew



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum