javascript - ReferenceError: document is not defined -


im beginner , new meteor. got problem test on travis-ci. want test color change of message , receive error in title. know how fix it? thanks

javascript

test('red color', function(done)  {       var e = document.getelementbyid('messages');       e.style.color = "#f00";       done(); }); 

html

<template name="messages">  <section id="messages">  <h2>messages:</h2>  {{#each messages}}  <strong>{{name}}:</strong> {{message}}<br>  {{/each}}  </section>  </template>  

'document' not defined in meteor. can try including jquery code. like: $("#messages").css("color", "red"); job. here documentation: https://api.jquery.com/id-selector/

if dont want change code use: var e = $("#messages");


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -