skip to Main Content

How to update all even rows using Javascript

For example with a div element, this code works: function col() { document.getElementById('myID').style.backgroundColor = // ... How can I do this for all even rows? This does not work: function col() { document.querySelectorAll("tr:nth-child(even)").style.backgroundColor = // ...

VIEW QUESTION

Javascript – MongoDB ECCONREFUSED when connecting to MongoDB Compass

I am trying to learn Node.JS from scratch. I am trying to connect index.js to MongoDB compass when I get the error: MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 at _handleConnectionErrors (/mnt/c/Users/user/Desktop/Programming/website/learningNode/mongoose/node_modules/mongoose/lib/connection.js:897:11) at NativeConnection.openUri (/mnt/c/Users/user/Desktop/Programming/website/learningNode/mongoose/node_modules/mongoose/lib/connection.js:848:11) { reason: TopologyDescription { type: 'Unknown', servers: Map(1)…

VIEW QUESTION
Back To Top
Search