Wednesday, October 15, 2008

How to get element in child window in javascript ?

***Parent Form Coding Parent.html

(html)
(body)
(input type='text' id='txtName')
(input type='button' id='btnOk' value='Ok'
onClick='window.open("Child.html","Child")')
(/body)
(/html)





***Child Form Coding Child.html
(html)
(head)
(script language='javascript')
function Show()
{
var test = window.opener.document.getElementById("txtName");
alert(test.value);

}

(/script)
(/head)
(body onLoad='Show()')
(/body)
(/html)

Note : Please replace () with <> for every html tags

2 comments:

Anonymous said...

Useful Information

Anonymous said...

Useful Information