I am stuck on an embarrassingly simple thing and I need help

I am stuck on an embarrassingly simple thing and I need help

I just created a simple function that will print out an argument passed to it in a selected div. I keep getting 'Uncaught Type Error: cannot read property 'style' of null', which to me seems as if the reference to the div is not being stored in the div variable created in the function, but I cannot figure out why. Here is the html:



http://scripts.js </body>

And here is the script:

function print(message) { var div = document.querySelector('#ouput'); div.style.background = 'tomato'; div.innerHTML += message; } print('?'); 

Can someone help please?

Submitted February 09, 2017 at 11:19PM by mayaswelltrythis
via reddit http://ift.tt/2k83LS8

Create wave along x-axis

Create wave along x-axis

This is a prototype of an LED strip lighting board. http://ift.tt/2kLWBF0

I am trying to configure some patterns in it but cannot find any algorithms online, I know about the nearest neighbour algorithm but would prefer something without having to give each LED an x&y value.

Can anyone hear create a wave of opacity across the x-axis?


Submitted February 09, 2017 at 10:16PM by nousernames2
via reddit http://ift.tt/2loe7SM