Method of dom/HTMLElementdom/HTMLElement
Syntaxvar object = object.setActive();
Return Value
Returns an object of type DOM NodeDOM Node
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
ExamplesThis example demonstrates how to use the setActive method between frames.
...
<SCRIPT>
function fnBottomActive(){
window.parent.oFrame1.secondButton.setActive();
}
</SCRIPT>
...
This example demonstrates how to use the setActive method between windows. By clicking the SetActive button in the left window, the method sets the Second Button as the active object in the right window, although the object does not receive focus. The object receives focus when its page receives focus. To confirm that the object is active, click the right window’s title bar. The button appears to be selected.
<HTML>
<HEAD>
<SCRIPT>
function fnOpen(){
oWin1 = window.open("/workshop/samples/author/dhtml/refs/setactive_content.htm",
"oWin1",
"top=10px,left=480px,height=375px,width=200px,resizable=1");
this.focus();
}
function fnBottomActive(){
window.parent.oWin1.secondButton.setActive();
}
</SCRIPT>
</HEAD>
<BODY onload="fnOpen();">
<CENTER>
<TABLE border="1">
<TR><TD>
<BUTTON id="btn1" onclick="fnBottomActive();">Set Active</BUTTON></TD></TR>
</TABLE>
</CENTER>
</BODY>
</HTML>
Notes Remarks
The setActive method does not cause the document to scroll to the active object in the current page or in another frame or window.
Syntax Standards informationThere are no standards that apply here.
AttributionsMicrosoft Developer Network: [Windows Internet Explorer API reference Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4