发现了一个<xmp></xmp>标签可用来输出html代码

来源:互联网 发布:js删除元素 编辑:程序博客网 时间:2024/05/08 00:26
今天想要在页面上输出html代码,找了发现了xmp标签 挺好用的 跟大家来分享一下
<!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>    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />    <script src="jquery1-11.js"></script>    <script src="jquery.cookie.js"></script>    <script>        $(document).ready(function(){            if($.cookie("userName")){                alert('填充cookie');                $('.userName').val($.cookie("userName"));                $('.pwd').val($.cookie("pwd"));            }            $('button').click(function(){                var userName=$('.userName').val();                var pwd=$('.pwd').val();                $.cookie("userName",userName,{expires:7});//                保存七天                $.cookie('pwd',pwd,{expires:7});                alert('成功胜出cookie,下次进网页自动填充');            })        })    </script></head><body><xmp><input type="text" class="userName"/><br/><br/>    <input type="password" class="pwd"/><br/><br/>    <button >登录</button></xmp></body></html>
0 0
原创粉丝点击