jquery - Random background colour picker for tumblr -
i've got in code, should select random background colour every refresh, can't see what's wrong document.write
var bgcolorlist=new array("#ff871b", "#15efa1", "#51ddff", "#ff1b6c", "#000000") document.write('<meta name="color:background" content='+background=bgcolorlist[math.floor(math.random()*bgcolorlist.length)] + '>')
cheers!
you need semicolons after each line.
additionally, why seeing background color meta tag?
use line instead:
document.body.style.backgroundcolor = bgcolorlist[math.floor(math.random()*bgcolorlist.length)];
Comments
Post a Comment