## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Aug 17 09:32
• Jun 20 21:19
@bjorno43 banned @shenerd140
• Apr 25 17:13
@mstellaluna banned @cmal
• Jan 08 22:05
@mstellaluna banned @dertiuss323
• Nov 07 2018 04:42
User @texas2010 unbanned @ows-ali
• Nov 02 2018 16:25
@texas2010 banned @ows-ali
• Oct 12 2018 05:50
@bjorno43 banned @NACH74
• Oct 05 2018 23:02
@mstellaluna banned @JomoPipi
• Sep 16 2018 12:21
@bjorno43 banned @yash-kedia
• Sep 16 2018 12:16
@bjorno43 banned @vnikifirov
• Sep 05 2018 08:12
User @bjorno43 unbanned @androuino
• Sep 05 2018 07:38
@bjorno43 banned @androuino
• Aug 23 2018 16:57
User @bjorno43 unbanned @rahuldkjain
• Aug 23 2018 16:23
@bjorno43 banned @rahuldkjain
• Jul 29 2018 14:13
User @bjorno43 unbanned @jkyereh
• Jul 29 2018 01:00
@bjorno43 banned @jkyereh
• Jul 10 2018 22:09
@bjorno43 banned @manafn
• Jul 06 2018 15:20
@texas2010 banned @imlegend19
• Jul 03 2018 12:28
@bjorno43 banned @vbvmatta
• Jun 29 2018 13:54
@bjorno43 banned @OGTechnoBoy
Sonya Chan
@cysonya
So you already set computerChoice to = Math.random(), at that point computerChoice equals to something between 0 and 1. In your if statement you don't need to set it to Math.random() again
Wasiu Idowu
@Hoxtygen
@cysonya okay. so i should remove all instance of the math.random from the conditional statement? and what else?
Sonya Chan
@cysonya
Also to check if computerChoice is between 0 and 0.33, you would need to use comparison operators which are (<, >, <=, >= etc..)
Wasiu Idowu
@Hoxtygen
@cysonya i initially used =< but then it doesnt make sense to me
Sonya Chan
@cysonya
@Hoxtygen what are you confused about? :P
Wasiu Idowu
@Hoxtygen
@cysonya not really sure if its the right operator to use
@cysonya lest i forget i should thank you for your time
CamperBot
@camperbot
hoxtygen sends brownie points to @cysonya :sparkles: :thumbsup: :sparkles:
Sonya Chan
@cysonya
Hmm, ok let's check if computerChoice is between 0 and 0.33 first. How do you think you can check for that?
no problem :)
Wasiu Idowu
@Hoxtygen
using =< @cysonya
Shivam Mehta
@shivam13
hey any one help me with wikipedia viewer ??
Sonya Chan
@cysonya
@Hoxtygen I've messaged you, might be easier to help you out there :D
Shivam Mehta
@shivam13
i got the error when i click on the search button
Chris Rutherford
@cjrutherford
Can i get a critique on my Pomodoro timer so far?
Dylan
@dhcodes
it doesn't really function yet, but I think I can see where you're going. Looks fine, but the bg image takes awhile to load so you might opt for a color or pattern
Chris Rutherford
@cjrutherford
yeah, it's not functional just yet, and yeah I was thinking of using the loading bar as the timer visual.
the BG image is hosted somewhere out on the internet.... pulled in from google images.
mor1990
@mor1990
Hi everyone
I'm having a bit of trouble with my Wikipedia viewer
Occasionally it will append the info for a split second and then disappear, but most of the time it just won't work.
Kevin
@KevinBruland
@mor1990 im 90% sure its the form
@mor1990 and form control
@mor1990 delete the form element entirely and then try :)
@mor1990 just leave the inputs there
mor1990
@mor1990
@Benalron thanks for the response, I'll give it a try
CamperBot
@camperbot
mor1990 sends brownie points to @benalron :sparkles: :thumbsup: :sparkles:
Kevin
@KevinBruland
@mor1990 you are lucky that I specifically dealt with <form> screwing up a wikipedia viewer page... took me a while to figure it out the first time
@mor1990 since I was so used to starting at the JS
Luke
@lukenetti3
@mor1990 Yeah if you just change that form element to a div element it gets the results
mor1990
@mor1990
@Benalron It worked, thanks again.
CamperBot
@camperbot
mor1990 sends brownie points to @benalron :sparkles: :thumbsup: :sparkles:
:warning: mor1990 already gave benalron points
Kevin
@KevinBruland
@mor1990 NP
Luke
@lukenetti3
Can anyone help me with my Wikipedia Viewer. The code works fine, but my Javascript is a little messy. Any tips on how to clean up the .append section?http://codepen.io/lukenetti3/pen/akwEQk?editors=0010
Taras Yaremkiv
@Y-Taras

Hello everyone. I was trying to make my background change on button click but it changes only one time. Any suggestions what it wrong in my JS code?

function removeBackground() {
"use strict";

var newColor = document.getElementsByTagName('p');
var url2 = "url('http://wallpapercave.com/wp/w9yJH4s.jpg')";

function changeImage() {
var temp = document.getElementsByClassName('demo-layout-transparent')[0];
var newImage = temp.style.backgroundImage;
if (newImage == url1) {
newImage = url2;

} else {

newImage = url1;
console.log('url1 ', url1);
console.log('newImage = ', newImage);
}

temp.style.backgroundImage = newImage;
}
changeImage();

for (let i = 0; i < newColor.length; i += 1) {
newColor[i].style.color = "blue";
}

}

a link to the page on the codepen is http://codepen.io/Y-Taras/pen/rLJPxd

Bhushan933
@Bhushan933
Hi
Replace these two lines
the double quote is the diference
use outside single quote and inside single quote
I hope you got it ... are you?
Taras Yaremkiv
@Y-Taras
Nope
as far as I concerned
One can't use inside and outside doublequotes ore singlequotes
Bhushan933
@Bhushan933
no it will not create a problem, believe me it will work :)