利用wangEditor获取文章格式和内容


 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link href="wangEditor-master/dist/css/wangEditor.min.css" rel="stylesheet" />
<style>
    #div1 {
    width:50%;
    height:500px;
    
    }
//设置宽度

.wangEditor-container {
width:50% !important;
margin-left:30% !important;
height:300px;
}

</style>

</head>
<body>
    <form id="form1" runat="server">
    <div id="div1" >
    <p>请输入内容。。。。</p>
    </div>
        <input id="button" type="button" value="提交" />
        <script src="wangEditor-master/dist/js/lib/jquery-1.10.2.min.js"></script>
        <script src="wangEditor-master/dist/js/wangEditor.min.js"></script>
        <script>
            $(function () {
                var editor = new wangEditor('div1');
                editor.create();
            })
        </script>
    </form>
</body>
</html>
<script>
    $("#button").click(function () {
        var a = $("#div1").html();
        alert(a);
    });


</script>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM