function setday(myelement)
{
    if(myelement.id=="start_time")
    {
       //your code
    }
}

解决方案 »

  1.   

    <table class="nav-table"> 
      <tr> 
    <td align="right" width="15%"> 
    发送日期从: </td> 
    <td align="left" width="20%"> 
    <input id="start_time"  runat="server" name="start" onfocus="setday(this)" type="text" cssclass="border_text"  /> 
    </td> 
    <td align="right" style="width: 88px"> 
    到: </td> 
    <td align="left" colspan="2"> 
    <input id="stop_time" runat="server" name="stop" onfocus="setday(this)" type="text" cssclass="border_text" enableviewstate="true" /> 
                                                          
    </td> 
    </tr> 
    <table> 
    <script language="javascript">
    function setday(myelement) 

        if(myelement.id=="start_time") 
        { 
           alert("Start="+myelement.value);
        } else if (myelement.id=="stop_time"){
         alert("Stop="+myelement.value)
        }
    }
    </script>  
      

  2.   

    <table>
    <tr><td colspan="4" id="sug" style="color:blue">您选择的是:</td></tr><td align="right" width="15%"> 
    发送日期从: </td> 
    <td align="left" width="20%"> 
    <input id="start_time"  runat="server" name="start" onfocus="setday(this)" type="text" cssclass="border_text"  /> 
    </td> 
    <td align="right" style="width: 88px"> 
    到: </td> 
    <td align="left" colspan="2"> 
    <input id="stop_time" runat="server" name="stop" onfocus="setday(this)" type="text" cssclass="border_text" enableviewstate="true" /> 
                                                          
    </td> 
    </tr>
    </table>
    <script>
    function setday(obj){
    document.getElementById('sug').innerHTML= '您选择的是:'+obj.id;
    }
    </script>
    如何知道当前选择的 是 input id="start_time"  还是 input id="stop_time"  呢?
      

  3.   

    setday不是有传this吗,
    那就直接取元素的id就行了