• ASP.NET


    效果:

    项目结构:

    前端代码:

    <%@ 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>KindEditor简单使用</title>
    
        <script src="Kindeditor/lang/zh_CN.js"></script>
        <link href="Kindeditor/themes/default/default.css" rel="stylesheet" />
        <script src="Kindeditor/kindeditor-min.js"></script>
    
        <script type ="text/javascript">
            var editor;
            KindEditor.ready(function (K) {
                editor = K.create('textarea[name="content"]', {
                    resizeType: 1,
                    items: ['fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist']
                });
            });
        </script>
    
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <textarea id ="KindEditor" name="content" style="741px;height:200px;visibility:hidden;"></textarea>
        </div>
        </form>
    </body>
    </html>
    

      

    怎么获取文本框中的值:

      · 在此之前引入JQuery

    editor.sync();
    var text = $.trim($('#KindEditor').val());
    alert(text);
    

      

  • 相关阅读:
    ASP.NET Core
    ASP.NET Core
    ASP.NET Core
    ASP.NET Core
    通用查询设计思想(2)- 基于ADO.Net的设计
    API接口通讯参数规范(2)
    Centos7 安装selenium(python3.7 centos7 )
    mysql (create temporary table table_name )临时表创建
    C# 字符串 String、StringBuffer和StringBuilder的区别
    安装Elasticsearch
  • 原文地址:https://www.cnblogs.com/KTblog/p/4765665.html
Copyright © 2020-2023  润新知