利用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