Как получить ввод HTML-редактора в текстовую область с помощью JavaScriptJquery

Программирование на jquery
Ответить
Гость
 Как получить ввод HTML-редактора в текстовую область с помощью JavaScript

Сообщение Гость »


Please I'm working on a project to make html editor. I downloaded a program online trying to modify it to my need, I'm having difficulty to get the inner html of the edit using javascript or jquery output it in

Код: Выделить всё

textarea and input type
so I can save it to my database. It only shows the output in html element but not in textarea.

MORE EXPLANATION OF WHAT I NEED
  • 1 when I key text in the editor I want it to return the in a hidden textarea.
  • 2 I want to be able to save the in my database.
  • 3 I want the editor the have default text to display LIKE

    Код: Выделить всё

    [please start typing your code here]

Please this is what have been giving me trouble to complete my work I will appreciate if anyone can help me or suggest another method or program to use in archive this. Thank you guys here is the program

HTML

Код: Выделить всё

  .ace-md{   height: 300px; }                Markdown Editor                        Markdown Preview                   
J QUERY-LIBERY TO MAKE IT WORK
J QUERY SCRIPT

Код: Выделить всё

 var app = angular.module('app', []); app.controller('ctrl', [     '$scope',     function ($scope) {         ace.config.set('basePath', '//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/');     } ]); app.directive('aceCodeEditor', [function () {         return {             link: function (scope, element, attrs) {                 scope.editor = ace.edit(element[0]);                 scope.editor.getSession().setMode('ace/mode/markdown');                 scope.editor.setTheme('ace/theme/monokai');                 scope.editor.getSession().on('change', function (e) {                     scope.$emit('ace.editor.change');                 });             }         };     }]); app.directive('markdownViewer', [function () {         return {             link: function (scope, element, attrs) {                 scope.$on('ace.editor.change', function () {                     element.html(marked(scope.editor.getValue()));                     element.find('pre code').each(function (i, block) {                         hljs.highlightBlock(block);                     });                     element.find('table').addClass('table');                 });             }         };     }]);//HERE I TRY USING JAVASRCIPT BUT IT DIDN'T WORK  //document.getElementById('outpt-hm').value = getElementsByClassName("ace_text-input").innerHTML;   


Источник: https://stackoverflow.com/questions/350 ... javascript
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Jquery»