概述
让指定元素获得键盘焦点
语法
element.focus();
规范
DOM Level 1 HTML: various elements.focus
DOM Level 2 HTML: various elements.focus
让指定元素获得键盘焦点
element.focus();
DOM Level 1 HTML: various elements.focus
DOM Level 2 HTML: various elements.focus
HTMLElement
HTMLElement.contentEditable
HTMLElement.dataset
HTMLElement.dir
HTMLElement.isContentEditable
HTMLElement.lang
HTMLElement.offsetHeight
HTMLElement.offsetLeft
HTMLElement.offsetParent
HTMLElement.offsetTop
HTMLElement.offsetWidth
GlobalEventHandlers.onabort
GlobalEventHandlers.onblur
GlobalEventHandlers.onchange
GlobalEventHandlers.onclick
GlobalEventHandlers.onclose
GlobalEventHandlers.oncontextmenu
HTMLElement.oncopy
HTMLElement.oncut
GlobalEventHandlers.ondblclick
GlobalEventHandlers.onerror
GlobalEventHandlers.onfocus
GlobalEventHandlers.oninput
GlobalEventHandlers.onkeydown
GlobalEventHandlers.onkeypress
GlobalEventHandlers.onkeyup
GlobalEventHandlers.onload
GlobalEventHandlers.onmousedown
GlobalEventHandlers.onmousemove
GlobalEventHandlers.onmouseout
GlobalEventHandlers.onmouseover
GlobalEventHandlers.onmouseup
HTMLElement.onpaste
GlobalEventHandlers.onscroll
GlobalEventHandlers.onselect
GlobalEventHandlers.onsubmit
HTMLElement.style
HTMLElement.tabIndex
HTMLElement.title
HTMLElement.blur()
HTMLElement.click()
HTMLElement.focus()
HTMLElement.forceSpellCheck()
BeforeUnloadEvent
DOMStringMap
DataTransfer
DragEvent
ErrorEvent
GlobalEventHandlers
HTMLAnchorElement
HTMLAreaElement
HTMLAudioElement
HTMLBRElement
HTMLBaseElement
HTMLBaseFontElement
HTMLBodyElement
HTMLButtonElement
HTMLCanvasElement
HTMLContentElement
HTMLDListElement
HTMLDataElement
HTMLDataListElement
HTMLDialogElement
HTMLDivElement
HTMLDocument
HTMLEmbedElement
HTMLFieldSetElement
HTMLFormControlsCollection
HTMLFormElement
HTMLFrameSetElement
HTMLHRElement
HTMLHeadElement
HTMLHeadingElement
HTMLHtmlElement
HTMLIFrameElement
HTMLImageElement
HTMLInputElement
HTMLIsIndexElement
HTMLKeygenElement
HTMLLIElement
HTMLLabelElement
HTMLLegendElement
HTMLLinkElement
HTMLMapElement
HTMLMediaElement
HTMLMetaElement
HTMLMeterElement
HTMLModElement
HTMLOListElement
HTMLObjectElement
HTMLOptGroupElement
HTMLOptionElement
HTMLOptionsCollection
HTMLOutputElement
HTMLParagraphElement
HTMLParamElement
HTMLPictureElement
HTMLPreElement
HTMLProgressElement
HTMLQuoteElement
HTMLScriptElement
HTMLSelectElement
HTMLShadowElement
HTMLSourceElement
HTMLSpanElement
HTMLStyleElement
HTMLTableCaptionElement
HTMLTableCellElement
HTMLTableColElement
HTMLTableDataCellElement
HTMLTableElement
HTMLTableHeaderCellElement
HTMLTableRowElement
HTMLTableSectionElement
HTMLTextAreaElement
HTMLTimeElement
HTMLTitleElement
HTMLTrackElement
HTMLUListElement
HTMLUnknownElement
HTMLVideoElement
HashChangeEvent
History
ImageData
Location
MessageChannel
MessageEvent
MessagePort
Navigator
NavigatorGeolocation
NavigatorID
NavigatorLanguage
NavigatorOnLine
NavigatorPlugins
PageTransitionEvent
Plugin
PluginArray
PopStateEvent
PortCollection
RadioNodeList
Transferable
ValidityState
WebVTT
Window
WindowBase64
WindowEventHandlers
WindowTimers