本帖最后由 li2guangwei 于 2015-01-06 21:22:55 编辑

解决方案 »

  1.   

    html里面设置就好了
    如果通过JS设置:<!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title></title>
    </head>
    <body>
        <table style="width:100px;">
            <tr>
                <td>
                    <input id="Text1" type="text" />
                    <span id="sp1" style="width:100px; border:1px red solid; padding:1px 2px;">tip message.</span>
                </td>
            </tr>
        </table>
    </body>
    </html>
    <script src="../Scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript">
        var sp = document.getElementById('sp1');
        sp.parentNode.style.position = "relative";
        sp.style.position = "absolute";
        sp.style.left = ($('#Text1').outerWidth + 5) + 'px';
    </script>