I am trying to access elements of one frame to another by doing the following:
But I have an asp page that is rendered in the frame with the following html and the <a> is not being picked up with the above code:Code:function GetClientId(strid) { var i = 0; var eleName; var breakout = 0; for (j = 0; j < parent.right.document.forms.length; j++) { for (i = 0; i < parent.right.document.forms[j].length; i++) { eleName = parent.right.document.forms[j].elements[i].id; pos = eleName.indexOf(strid); if (pos >= 0) { breakout = 1; break; } } } if (breakout == 0) eleName = ""; return eleName; }
Why is this? Is it because <a> are not part of document.forms? More importantly how would I go through all html tags?HTML Code:<a id="ctl00_btnLogin" tabindex="3" class="button loginbutton" class="loginbutton" onkeypress="return WebForm_FireDefaultButton(event, 'ctl00_btnLogin');" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$btnLogin", "", true, "LoginControl", "", false, true))"><span>Log In</span></a>


Reply With Quote

Bookmarks