例子2、代码可以正常执行

事例1、代码能够健康施行:

<%@ page language=”java” import=”java.util.*”
pageEncoding=”UTF-8″%>

<html>

<head>

  <style>span {display:none;}</style>

  <script
src=”;

</head>

 

  <script>

    $(document).ready(function() {

        $(“input”).focus(function () {

            $(this).next(“span”).css(‘display’,’inline’).fadeOut(1000);

        });

    });

  </script>

 

<body>

 

  <p><input type=”text” /> <span>focus
fire</span></p>

  <p><input type=”password” /> <span>focus
fire</span></p>

 

 

</body>

</html>

 

 

 

事例2、代码能够日常实行:

 

 

<!DOCTYPE html>

<html>

<head>

  <style>span {display:none;}</style>

  <script
src=”;

</head>

<body>

  <p><input type=”text” /> <span>focus
fire</span></p>

 

<p><input type=”password” /> <span>focus
fire</span></p>

<script>

    $(“input”).focus(function () {

         $(this).next(“span”).css(‘display’,’inline’).fadeOut(1000);

    });

</script>

 

</body>

</html>

 

事例3、代码中的js不可能健康奉行

 

<!DOCTYPE html>

<html>

<head>

  <style>span {display:none;}</style>

  <script
src=”;

</head>

<script>

    $(“input”).focus(function () {

         $(this).next(“span”).css(‘display’,’inline’).fadeOut(1000);

    });

</script>

 

<body>

  <p><input type=”text” /> <span>focus
fire</span></p>

 

<p><input type=”password” /> <span>focus
fire</span></p>

 

</body>

</html>

%@ page language=java
import=java.util.* pageEncoding=UTF-8% html head stylespan
{display:none;}/style script src=…

相关文章