javascript--Event Object

Source: Internet
Author: User
Tags tagname

  • Event Source Object Event.srcElement.tagName Event.srcElement.type
  • Capture Release event.srcElement.setCapture (); Event.srcElement.releaseCapture ();
  • Event key event.keycode Event.shiftkey Event.altkey Event.ctrlkey
  • Event return value Event.returnvalue
  • mouse position event.x Event.y
  • form activity Element Document.activeelement
  • Bind event document.captureevents (Event.keydown);
  • Access Form element document.all ("TXT"). focus (); document.all ("TXT"). Select ();
  • form Command Document.execcommand
  • form Cookie document.cookie
  • Menu Event Document.oncontextmenu
  • Create element document.createelement ("SPAN");
  • get elements according to mouse: document.elementfrompoint (EVENT.X,EVENT.Y). tagname== "TD Document.elementfrompoint (EVENT.X,EVENT.Y). appendchild (ms)
  • form Picture document.images[index]
  • form Event binding Document.onmousedown=scrollwindow;
  • element document. form. elements[Index]
  • Object Binding Event document.all.xxx.detachEvent (' onclick ', a);
  • number of plugins navigator.plugins
  • take variable type typeof ($js _libpath) = = "Undefined"
  • Drop- down box Drop -down box. options[index] drop-down box. Options.length
  • Find Object document.getelementsbyname ("R1"); document.getElementById (ID);
  • timed timer=setinterval (' ScrollWindow () ', delay); Clearinterval (timer);
  • Uncode Code Escape (), unescape
  • Parent Object obj.parentelement (DHTML) Obj.parentnode (DOM)
  • the row of the interchange table Tableid.moverow (2,1)
  • Replace css document.all.csss.href = "A.css";
  • Display Side -by Display:inline
  • Hide Focus hidefocus=true
  • Style= "Word-break:break-all" according to the width of line wrapping
  • Auto Refresh <meta http-equiv= "Refresh" content= "8; Url=http://c98.yeah.net ">
  • Simple Mail <a href= "mailto:[email protected]? subject=ccc&body=xxxyyy" >
  • quick go to position Obj.scrollintoview (True)
  • anchor <a name= "First" > < a href= "#first" >anchors</a>
  • Web page pass parameter location.search ();
  • Editable Obj.contenteditable=true
  • Execute menu command obj.execcommand
  • Double-byte character /[^ "x00-" xff]/kanji/["u4e00-" u9fa5]/
  • let the English strings go beyond the table width to wrap Word-wrap:break-word; Word-break:break-all;
  • Transparent background <iframe src= "1.htm" width=300 height=180 allowtransparency></iframe>
  • Get style content Obj.style.cssText
  • HTML tag Document.documentElement.innerHTML
  • first style tag document.stylesheets[0]
  • the first style in a style tag document.stylesheets[0].rules[0]
  • when you prevent clicking on an empty link, the page is often reset to the top end of the page. <a href= "javascript:function ()" >word</a>
  • Previous page source asp:request.servervariables ("Http_referer") javascript:document.referrer
  • Freeing Memory CollectGarbage ();
  • Disable Right-click document.oncontextmenu = function () {return false;}
  • prohibit saving  <noscript><iframe src=" *.htm " ></iframe></noscript>
  • prohibit the selection of <body oncontextmenu=" return false "  ondragstart=  onselectstart =" return false "  onselect= "Document.selection.empty ()"  oncopy=< Span style= "margin:0px; padding:0px; Color:rgb (255,0,255) ">" Document.selection.empty () "  onbeforecopy=" return false " onmouseup=
  • prohibit pasting <input type=text onpaste= "return false" >
  • Address bar icon <link rel= "Shortcut icon" href= "Favicon.ico" > Favicon.ico name best unchanged 16*16 16 colors, put in the virtual directory root directory
  • Favorites Bar icon <link rel= "Bookmark" href= "Favicon.ico" >
  • View Source code <input Type=button value= View Web page sources onclick= "window.location = ' view-source: ' + ' http://www.csdn.net/'" >
  • Turn off IME <input style= "ime-mode:disabled" >
  • Auto Select all <input type=text name=text1 value= "123" onfocus= "This.select ()" >
  • enter key to move the cursor to the next input box <input onkeydown= "if (event.keycode==13) event.keycode=9" >
  • default value for text box <input type=text value= "123" onfocus= "alert (this.defaultvalue)" >
  • title newline obj.title = "123 SDFs"
  • The acquisition time represents the Microsecond var n1 = new Date ("2004-10-10". Replace (/-/g, ""/")). GetTime ()
  • whether the window closes win.closed
  • checkbox flat <input type=checkbox style= "Position:absolute; Clip:rect (5px 15px 15px 5px) "><br>
  • gets the selection document.selection.createRange (). Duplicate (). Text
  • AutoComplete feature <input type=text autocomplete=on> turn on this feature <input Type=text autocomplete=off> turn off this feature
  • window maximization <body onload= "Window.resizeto (window.screen.width-4,window.screen.height-50); Window.moveTo (-4, -4) ">
  • no Close button ie window.open ("aa.htm", "Meizz", "fullscreen=7");
  • Unified encode/decode alert (decodeuricomponent (encodeURIComponent ("http://hello. com?as= hehe")) encodeURIComponent /","; "and"? " also coded
  • table row indicates <tr onmouseover= "this.bgcolor= ' #f0f0f0 '" onmouseout= "this.bgcolor= ' #ffffff '" >

javascript--Event Object

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.