(027)jquery_表单选择器image

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <title>form_checkbox.html</title>
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
    <style type="text/css">
        .bg_red
        {
            background-color: green;
            width:159px;
            height:42px;
            padding:20px;
        }
    </style>
    <script type="text/javascript" src="../js/jquery/jquery190.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("#frmTest :image").addClass("bg_red");
        });
    </script>
  </head>
  
  <body>
        <h3>修改表单中图像元素的背景色</h3>
        <form id="frmTest" action="#">
            <input type="image" src="http://img.mukewang.com/52b284ea00016b2902590070.jpg" /><br />
            <br />
            <img alt="" src="http://img.mukewang.com/52b284ea00016b2902590070.jpg" /><br />
        </form>
  </body>
</html>

 

posted @ 2014-12-11 17:19  雪中飞雁  阅读(53)  评论(0)    收藏  举报