Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • May 10 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 25 17:12
    @mstellaluna banned @cmal
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:09
    thecodingaviator commented #31179
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:07
    thecodingaviator commented #31182
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator commented #31190
  • Apr 01 18:05
    thecodingaviator commented #31157
  • Apr 01 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

  • Apr 01 18:04
    thecodingaviator closed #31157
  • Apr 01 18:04
    thecodingaviator closed #33788
  • Apr 01 18:04
    thecodingaviator commented #33788
  • Apr 01 18:02
    thecodingaviator closed #31059
  • Apr 01 18:02
    thecodingaviator commented #31059
Tiago Correia
@tiagocorreiaalmeida
and tell me how it works
add that line in the place you commented the other
you have to search inputs on your html?
image.png
image.png
Simon Cordova
@gbsimon87
Hey sorry, didn't see you had texted...
I just tried what you said
If it doesn't work I'm scrapping it
It may be another javascript overriding mine
Tiago Correia
@tiagocorreiaalmeida
you have 2 times the same input?
see the images
yeah that's the problem
so you will need to loop the ammount of elements
that has the id searchtext
that's it
Simon Cordova
@gbsimon87
Ok I'll try that out as
well
thanks buds
Tiago Correia
@tiagocorreiaalmeida

window.addEventListener('DOMContentLoaded', function() {
var textbar= document.querySelectorAll('#searchText');

progress.forEach(function(element) {
element.setAttribute("placeholder", "blabla");
});
});

try this
wait

window.addEventListener('DOMContentLoaded', function() {
var textbar= document.querySelectorAll('#searchText');

textbar= (function(element) {
element.setAttribute("placeholder", "blabla");
});
});

notworking
will try soemthing unthil it works
Markus Kiili
@Masd925
@tiagocorreiaalmeida You forgot the forEach on the last code?
Tiago Correia
@tiagocorreiaalmeida
yeah
but something seems to not be working in here
Simon Cordova
@gbsimon87
@tiagocorreiaalmeida thanks buds I really appreaciate it
CamperBot
@camperbot
gbsimon87 sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
api offline
Tiago Correia
@tiagocorreiaalmeida
@gbsimon87

window.addEventListener('DOMContentLoaded', function() {
var textbar= document.querySelectorAll('#searchText');

textbar.forEach= (function(element) {
element.setAttribute("placeholder", "blabla");
});
});

try this
and tell me what happens
Markus Kiili
@Masd925
@tiagocorreiaalmeida The syntax is nodeList.forEach(callback[, thisArg]);, not nodeList.forEach = callback
Kiwalabye Richard
@xdon55
Hey guys please help me here. tell me the problem with my code. it only returns false.

function mutation(arr) {
  var lowerCaseArr = arr.map(function(x){
    return x.toLowerCase();
  });
   for(var j=0;j<lowerCaseArr[1].length;j++){
     var posOfLetter = lowerCaseArr[0].indexOf(j);
     if(posOfLetter !== -1){
       return true;

     } else {
       return false;
     }
   }
}

mutation(["hello", "hey"]);
Markus Kiili
@Masd925
@xdon55 Your code is looking for a number j in the array here lowerCaseArr[0].indexOf(j);
Also, can you really return true if one looped character is found?
Aminu Ibrahim Abubakar
@aminukano585
What do you want to do? @xdon55
Kiwalabye Richard
@xdon55
@AminuSufi585 i want to return false if all letters of second string in arr are not found in the first string. and return true if otherwise.
Aminu Ibrahim Abubakar
@aminukano585
Ok let me check your code I'll get back to you shortly
Aminu Ibrahim Abubakar
@aminukano585
@xdon55 Do it this way
function mutation(arr) {
  var lowerCaseArr = arr.map(function(x){
    return x.toLowerCase();
  });

  for(var j=0;j<lowerCaseArr[1].length;j++){
     var posOfLetter = lowerCaseArr[0].indexOf(lowerCaseArr[1][j]);
     if(posOfLetter === -1){
       return false;
     } 
  }
  return true;
}

mutation(["hello", "hey"]);
You can see that, you need to include the index of the particular characters in the string as well
and also you need to test whether its not found in each iteration
No need of else, if everything was found after the loop
It means it was automatically true
Hope it helps @xdon55
Kiwalabye Richard
@xdon55
@AminuSufi585 thanks. that helped alot
CamperBot
@camperbot
xdon55 sends brownie points to @aminusufi585 :sparkles: :thumbsup: :sparkles: