<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>jquery聚焦文本框 - 计划 - 博客园</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<form action="http://www.google.com.hk" id="cse-search-box">
      <div>
        <input type="hidden" name="cx" value="partner-pub-7740261255677392:7064996710" />
        <input type="hidden" name="ie" value="UTF-8" />
        <!--文本框--><input type="text" name="q" size="25" />
        <input type="submit" name="sa" value="&#x641c;&#x7d22;" />
      </div>
    </form>

<script type="text/javascript">
    $(document).ready(function () {
        $("input[name='q']").focus();
    })</script>
</body>
</html>
posted on 2012-10-02 23:18  计划  阅读(9386)  评论(0编辑  收藏  举报