1. naming those inputs with indexes
2. if those inputs are very regular, use element.sourceIndex to figure out the index
3. enumerate through all inputs and figure out the index
2. if those inputs are very regular, use element.sourceIndex to figure out the index
3. enumerate through all inputs and figure out the index
{
if (form1.input[i] == document.activeElement)
{
alert(form1.input[i].value);
return true; }
}
<input onfocus=show(this)>
<input onfocus=show(this)>
<input onfocus=show(this)>
<input onfocus=show(this)>
</form>
<script>function show(e){window.status=e.sourceIndex-e.parentElement.sourceIndex}</script>