Search code examples
node.jsquill

How to pass data from div like from input in nodejs


I want to pass data from quill editor but problem is that editor is div. In which is another div created after pageload.

Handlebars

<!-- Create the editor container -->
    <div id="editor" name="body">

    <div class="another div created after page load">
    </div>

    </div>

But problem is that i cant probably pass data from div it needs to be input but i have no idea how can i make it.

Controller for articles

exports.articleAdd = function (req, res) {
    let article = new Article();
    article.heading = req.body.heading;
    article.author = req.user.firstname;
    article.body = req.body.body;

    article.save(function (err) {
        if (err) {
            console.log(err);
            return;
        } else {
            res.redirect('/');
        }
    });

}

Solution

  • Its solved on their official site. https://quilljs.com/playground/#form-submit