Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • 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
korzo
@korzo
@finkbeca So to make your script work you need to replace line 14 with var item = document.getElementsByClassName("todolist")[0].value;
iso
@iso1048
@piteto did not even think of that.
piteto
@piteto
in js, we would just use textContent instead of innerHTML if we don't want the html
rafaelmonroy
@rafaelmonroy
@piteto yeah that works too, then there is no need for the replace. good one, thanks guys!
CamperBot
@camperbot
rafaelmonroy sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:warning: @piteto's account is not linked with freeCodeCamp. Please visit the settings and link your GitHub account.
piteto
@piteto
assume it's similar in jquery
Jorge
@flawedLogic506
@finkbeca try this: Example
@finkbeca if u open the console, you'll see whatever you enter in the text field
Colin
@finkbeca
@OrangeKulture Thanks, any way to display it on screen?
CamperBot
@camperbot
finkbeca sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 449 | @orangekulture |http://www.freecodecamp.com/orangekulture
Jorge
@flawedLogic506
@finkbeca yeah i just console logged it so you can see it .. from there, you can definitely do what you would like .. let me show you
Colin
@finkbeca
ok
Jorge
@flawedLogic506
@finkbeca try again
something like that .. i mean depends on what you wanna do and all, probably best to do appendChild
or something along those lines
Colin
@finkbeca
thanks
rafaelmonroy
@rafaelmonroy
@gothamknight @piteto do you guys know if it is possible to filter out the data coming in my GET request to only those that have length of 150 character or less ?
I was thinking about using a if else statement
Jorge
@flawedLogic506
@rafaelmonroy u cannot condition a response from the server .. not unless it accepts parameters in your call
rafaelmonroy
@rafaelmonroy
@OrangeKulture what do you mean by “not unless it accepts parameters in your call"
Jorge
@flawedLogic506
you can pass in certain parameters in your headers when making a call to an API ..
generally speaking tho, you cant just ask the server for some data and filter the incoming data. What you can do, is once you have the response, then mess with the data in whatever way u need
rafaelmonroy
@rafaelmonroy
can i pass the data into a vairable from the call?
@OrangeKulture
in the success function?
Jorge
@flawedLogic506
@rafaelmonroy yeap exactly .. thats a good way to manipulate the data
hifede
@hifede
hi guys! currently trying to put together my portfolio profile and i'm stuck with a few things... right now i'm trying to get the images under "work" to all be square shaped and the same size. could anyone help me pls ? https://codepen.io/arolf_flora/pen/XajbJa
rafaelmonroy
@rafaelmonroy
@OrangeKulture nice, alright thanks man, im going mess around with it a bit more.
CamperBot
@camperbot
rafaelmonroy sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 450 | @orangekulture |http://www.freecodecamp.com/orangekulture
Jorge
@flawedLogic506
@rafaelmonroy sure thing, if u still have some doubts, drop a msg in here .. always someone willing to help out
@hifede i would probably have the images inside a containing element, like a div .. then i would specify a width and hide for all images inside that div
@hifede also .. make sure you have the right thumbnail class .. i use bootstrap 3, so i know its img-thumbnail, im not sure if it changed for bootstrap 4
rafaelmonroy
@rafaelmonroy
what is the best way in JQuery to change the background color everytime the same button is clicked, so far i have this. but it wont change back to original color
$("body").on("click", function (){
      $(this).css("background-color", "#000ff00");
    });
Jorge
@flawedLogic506
@rafaelmonroy u need a flag ..
rafaelmonroy
@rafaelmonroy
@OrangeKulture a flag?
iso
@iso1048
@rafaelmonroy you can make an array of background-colors and generate a random number each time the button is clicked which you can use to access a color in the array.
Jorge
@flawedLogic506
let flag = false;
$("body").on("click", function (){
      if(!flag){
       $(this).css("background-color", "#000ff00");
       flag = true;
      }else
       $(this).css("background-color", "#someothercolor");
       flag = false;
    });
rafaelmonroy
@rafaelmonroy
@OrangeKulture oh man, never seen anything like that lol I tried but didnt work
Jorge
@flawedLogic506
i wouldnt attach a click event to the body tho
rafaelmonroy
@rafaelmonroy
@OrangeKulture yeah you’re right
Jorge
@flawedLogic506
@rafaelmonroy example
Trommelochse
@Trommelochse
thanks @OrangeKulture for not letting people attaching click events to the body <3
CamperBot
@camperbot
trommelochse sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 451 | @orangekulture |http://www.freecodecamp.com/orangekulture
Jorge
@flawedLogic506
@Trommelochse hahah sure! :joy:
Trommelochse
@Trommelochse
:D
Tom
@moT01
if you just want to switch between two backgrounds check out jquerys toggleClass() method https://stackoverflow.com/questions/9714498/toggle-div-color-on-click @rafaelmonroy