ANZO Написал:Как бы поиск компонента в документе только по elementId или тагу и идет. Откуда код знает какой элемент вам надо найти в документе?
Мне нужно ввести логин и пароль. Они подгружаются через js. Вот мне нужно узнать какой так или elementId, как его вывести?
Добавлено через 2 часа 17 минут
[SRC="php"]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
<style type="text/css" media="screen">@import 'themes/elt_lite/login.css'/**/;</style>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
function firstFocus() {
if (document.forms.length > 0)
{
var f = document.forms[0];
for (var i=0; i<f.length; i++)
{
var e = f.elements[i];
if ((e.name) && (e.type) && ((e.type=='text') || (e.type=='textarea')) && (!e.disabled))
{
e.focus();
break;
}
}
}
}
//--><!]]>
</script>
</head>
<body id="login" onload="firstFocus();">
<!-- Start #login-container -->
<div id="login-container">
<!-- redirect to splash for all cases. Set splashpage iframe src to "https://hostname/cas/login#splashpage" -->
<script type="text/javascript">
var queryString = window.location.search;
if (window.location == window.parent.location || !queryString || queryString.indexOf("page=splashpage") < 0) {
var splashURL = "http://" + window.location.hostname + "/p/splash";
window.open(splashURL,"_top");
}
</script>
<!-- Start #login-form -->
<div id="login-form-container">
<form id="fm1" class="fm-v clearfix" action="/cas/login?page=splashpage&target=top&service=/p/cas" method="post">
<fieldset>
<ol>
<li>
<!--
--**Usability project change has been started
--**Label is disable because UserName is coming dynamically from Resource bundle class (message.properties)
-->
<!--<label for="username">User ID:</label>-->
<label for="username">User ID</label>
<!--**Usability project change has been ended -->
<input id="username" name="username" class="required" tabindex="1" accesskey="n" type="text" value="" autocomplete="on"/>
</li>
<li>
<!--
--**Usability project change started
--**Label is disable because password is coming dynamically from Resourcebundle class (message.properties)
-->
<!-- <label for="password">Password:</label>-->
<label for="password">Password</label>
<!--**Usability project change has been Ended -->
<input id="password" name="password" class="required" tabindex="2" accesskey="p" type="password" value="" autocomplete="on"/>
</li>
<li class="last">
<button type="submit" name="submit" title="Login">Login</button>
<input type="hidden" name="lt" value="_тут_значение" />
<input type="hidden" name="_eventId" value="submit" />
</li>
</ol>
</fieldset>
</form>
</div>
<!-- End #login-container -->
</body>
</html>[/SRC]
Вот как вытащить elementId?