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
Post a Comment