zoukankan      html  css  js  c++  java
  • kindedit

    <!doctype html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title>Default Examples</title>
        <style>
            form
            {
                margin: 0;
            }
            textarea
            {
                display: block;
            }
        </style>
        <link rel="stylesheet" href="http://kindeditor.net/ke4/themes/default/default.css" />
        <script charset="utf-8" src="http://kindeditor.net/ke4/kindeditor-min.js"></script>
        <script charset="utf-8" src="http://kindeditor.net/ke4/lang/zh_CN.js"></script>
        <script>
            var editor;
            KindEditor.ready(function (K) {
                editor = K.create('textarea[name="content"]', {
                    allowFileManager: true
                });
                K('input[name=getHtml]').click(function (e) {
                    alert(editor.html());
                });
                K('input[name=getText]').click(function (e) {
                    alert(editor.text());
                });
                K('input[name=setHtml]').click(function (e) {
                    //设置HTML
                    editor.html('<h3>Hello KindEditor</h3>');
                });
                K('input[name=setText]').click(function (e) {
                    //设置文本
                    editor.text('<h3>Hello KindEditor</h3>');
                });
            });
        </script>
    </head>
    <body>
        <h3>
            默认模式</h3>
        <form>
        <textarea name="content" style=" 800px; height: 400px; visibility: hidden;">KindEditor</textarea>
        <p>
            <input type="button" name="getHtml" value="取得HTML" />
            <input type="button" name="getText" value="取得文本(包含img,embed)" />
            <br />
            <input type="button" name="setHtml" value="设置HTML" />
            <input type="button" name="setText" value="设置文本" />
        </p>
        </form>
    </body>
    </html>
  • 相关阅读:
    Leetcode 191.位1的个数 By Python
    反向传播的推导
    Leetcode 268.缺失数字 By Python
    Leetcode 326.3的幂 By Python
    Leetcode 28.实现strStr() By Python
    Leetcode 7.反转整数 By Python
    Leetcode 125.验证回文串 By Python
    Leetcode 1.两数之和 By Python
    Hdoj 1008.Elevator 题解
    TZOJ 车辆拥挤相互往里走
  • 原文地址:https://www.cnblogs.com/go4mi/p/5725181.html
Copyright © 2011-2022 走看看