JavaScript常用事件



onblur:(        ,            ) 
onchange:(        ,          ) 
onclick:(           ) 
ondblclick:(           ) 
onfocus:(        ,          ) 
onkeydown: (         ) 
onkeypress:(            ) 
onkeyup:(         ) 
onload:( body     ,         ) 
onmousedown:(         ) 
onmousemove:(             ) 
onmouseout:(           ) 
onmouseover:(            ) 
onmouseup:(          ) 
onreset:(       ,        ) 
onselect:(       ,         ) 
onsubmit:(       ,        ) 
onunload:(  body   ,        )



click()   .click()       。
closed   .closed          true/false
clearTimeout(  )       setTimeout  
clearInterval(  )       setInterval  
confirm("    ")      ,    true    false
cursor:          hand crosshair text wait help default auto e/s/w/n-resize

event.clientX           X   ;
event.clientY           Y   ;
event.offsetX         X   
event.offsetY         Y   

document.write(document.lastModified)           
document.ondblclick=x          
document.onmousedown=x          

document.body.scrollTop;                 ,      ,
document.body.scrollLeft;                 ,      ,
document.title document.title="message";           
document.bgcolor document.bgcolor="   ";         
document.Fgcolor document.Fgcolor="   ";       
document.linkcolor document.linkcolor="   ";        
document.alinkcolor document.alinkcolor="   ";           
document.VlinkColor document.VlinkColor="   ";           
document.forms.length      form   
document.anchors.length          
document.links.length           
document.onmousedown=x         
document.ondblclick=x         
defaultStatus window.status=defaultStatus;           

function function xx(){...}     
isNumeric        
innerHTML xx=  .innerHTML          html   
innerText divid.innerText=xx   div   id        XX

location.reload();      ,target          

Math.random()     ,   0 1    ,        ,   *10,   
Math.floor(number)    number    ,      
Math.min(1,2)   1,2   
Math.max(1,2)   1,2   

navigator.appName          
navigator.appVersion           
navigator.appCodeName            
navigator.userAgent             

onsubmit onsubmit="return(xx())"        
opener opener.document.            

prompt xx=window.prompt("    ","   ");     
parent parent.   .         

return return false    
random     (0 1  )
reset() form.reset();  form        

split("") string.split("")  string         
submit() form  .submit()  form      

String    charAt(x)                 
lastIndexOf("string")           ,    -1
indexOf("string")           ,    -1
LowerCase()           
UpperCase()          
substring(0,5) string.substring(x,x)       0 5   
setTimeout("function",time)         
setInterval("function",time)         

toLocaleString() x.toLocaleString()  x         ,        
typeof(   )        ,  :String,Boolean,Object,Function,Underfined

window.event.button==1/2/3        1    2       3
window.screen.availWidth         (    )
window.screen.availHeight         (    )
window.screen.width         (    )
window.screen.height         (    )
window.document.body.offsetHeight;         
window.document.body.offsetWidth;         
window.resizeTo(0,0)        
window.moveTo(0,0)         
window.focus()          
window.scroll(x,y)        ,y      ,      
window.open() window.open("  ","  ","  ") 
  :toolbar(   ),location(   ),directions,status(   ),
menubar (   ),scrollbar(   ),resizable(    ), width( ),height( ),fullscreen(   ),scrollbars(           ,channelmode(  ),left(    x  ),top(    y  )
window.location = 'view-source:' + window.location.href            ;


a=new Date(); //  a         
y=a.getYear(); //y      a            
y1=a.getFullYear(); //            
m=a.getMonth(); //     
d=a.getDate(); //     
d1=a.getDay(); //       
h=a.getHours(); //       
m1=a.getMinutes(); //       
s=a.getSeconds(); //       


  .style.fontSize="    ";
  :mm/cm/in  /pc /pt /px  /em   
1in=1.25cm
1pc=12pt
1pt=1.2px(800*600    )

      :
fontSize  
family  
color  
fontStyle  ,   normal  ,italic  ,oblique     
fontWeight  ,   100 900  ,900  ,light,normal,bold
letterSpacing  ,       ,   ,1pt,10px,1cm
textDecoration:    ;  ,none   ,underline   ,overline   
background:      ,
backgroundImage:    ,          


             :

1.onClick       
2.onLoad      ,     body 
3.onUnload          ,     body 
4.onmouseover         
5.onmouseout         
6.onmouseup      
7.onmousedown       
8.onFocus         
9.onSelect           
10.onChange          
11.onBlur        
onsubmit=return(ss())         

   border-bottom:1x solid black
   border-bottom:1x dotted black
    border-bottom:2x dashed black
   border-bottom:5x double black
   border-bottom:1x groove black
   border-bottom:1x ridge black


1.    glow(color=  ,strength=    )

2.    fliph()        180 

3.    flipv()        180 

4.    blur(add=true/false direction=   strength=  )
add             direction    strength    
5.    alpha(opaction=0-100,finishopacity=0-100,style=0/1/2/3)
opaction        finishopacity                         style      0     ,1     ,2     ,3     
6.    chroma(color=   )                 
7.    dropshadow(color=    ,offx=        ,offy=        )
8.  gray()        
9.    invert()        
10.  light()        
11.  mask(color=  )                

opacity       .0~100,0    ,100      
finishopacity            .0~100.
style        .0     .1   .2    .3    .
startx.starty           X Y  .
finishx,finishy         x,y    .
add                  .  0,1.0 " ",1 " ".
direction       .0      ,45      .      270 .left,right,down,up.
strength         .                  .   5 .
color      .
offx,offy   x,y         .
positive     .0         .1             ..

AddAmbient:       .
AddCone:      .
AddPoint     
Changcolor:      .
Changstrength:       .
Clear:       .
MoveLight:    .

freq      ,                     .
lightstrength            .  0~100   ,        0~360 .0  0   ,25  90   .
strength     .


hand style="cursor:hand"
crosshair style="cursor:crosshair"
text style="cursor:text"
wait style="cursor:wait"
default style="cursor:default" 
help style="cursor:help"
e-resize style="cursor:e-resize"
ne-resize style="cursor:ne-resize"
n-resize style="cursor:n-resize"
nw-resize style="cursor:nw-resize"
w-resize style="cursor:w-resize"
s-resize style="cursor:s-resize"
sw-resize style="cursor:sw-resize "
se-resize style="cursor:se-resize"
auto style="cursor:auto"