How to access DOM element from within the clientsDAO.js model?

0

I'm doing a query to the database, and to display the result on a #form element of the form, Nodejs does not recognize the document.getElementById ('element'), nor jQuery.

Error:

ReferenceError: document is not defined

My method:

ClientesDAO.prototype.getEstados = function(res, res){
    var fb = this._firebase.database();
    var result = fb.ref().child('estados/').orderByChild('nome');
    result.once('value', function(snapshot){
        document.getElementById("estados").innerHTML(snapshot.val());
    });
}
    
asked by anonymous 13.03.2017 / 04:35

0 answers