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
CamperBot
@camperbot
cmccormack sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
api offline
Jason Luboff
@JLuboff
I had to go double check lol
Bryan Reese
@breese8009
@cmccormack yea its a full temp literal
Tiago Correia
@tiagocorreiaalmeida
need a little help guys
$( document ).ready(function() {
    var percentage = $(".progress").attr("progress");
    console.log(percentage);
});
got this
<span><a class="progress" progress="75"></a></span>
<span><a class="progress" progress="65"></a></span>
<span><a class="progress" progress="75"></a></span>
how can I loop all that spans
and get the value of every one of them 1 by 1?
the code I have only runs the first 1
Diego Mayer
@Chrono79
@tiagocorreiaalmeida try storing all the class progress anchors in an array and then use a loop
Tiago Correia
@tiagocorreiaalmeida
yeah my problem is how can I store everyone of them?
Tiago Correia
@tiagocorreiaalmeida
that's the problem I would have to name 1 by one?
class
per each
?
Ronique Ricketts
@RoniqueRicketts
I just found out w3schools has a nodejs class. :O
Tiago Correia
@tiagocorreiaalmeida
To search for multiple class names, separate them with spaces, like "test demo".
nm
Diego Mayer
@Chrono79
use map or forEach @tiagocorreiaalmeida
Adel
@AdelMahjoub
@tiagocorreiaalmeida
window.addEventListener('DOMContentLoaded', function() {
  var progress = document.querySelectorAll('.progress');

  progress.forEach(function(percentage) {
    console.log(percentage.getAttribute('progress'))
  });
});
Jason Luboff
@JLuboff
@AdelMahjoub Coming out of the shadows of backend eh?
Adel
@AdelMahjoub
@JLuboff lol
@JLuboff got me :smile:
Jason Luboff
@JLuboff
:D
Adel
@AdelMahjoub
I 'm sneaking in all the fcc gitter channels
this one is the most active, after the main channel
Jason Luboff
@JLuboff
I can't stand the main channel
Adel
@AdelMahjoub
yeah hard to follow
Adel
@AdelMahjoub
@tiagocorreiaalmeida
$(document ).ready(function() {
  var progress = $(".progress");
  progress.each(function() {
    console.log($(this).attr("progress"))
  })
});
Tiago Correia
@tiagocorreiaalmeida
    var percentage = document.getElementsByClassName("progress")
    for(var i = 0; i<percentage.length; i++){
      $("."+percentage[i].getAttribute('class')).css("width",percentage[i].getAttribute('progress')+"%");
    }
shouldnt this work?
Adel
@AdelMahjoub
@tiagocorreiaalmeida what do you want to do ?
Tiago Correia
@tiagocorreiaalmeida
I have like 3 or 4 spans
and their width
will grow based
on a attribute
that called progress
so if progress 75 width of the div will be 75
Adel
@AdelMahjoub
@tiagocorreiaalmeida ah you want a progress bar based on theese value
Tiago Correia
@tiagocorreiaalmeida
yeah that's it
since I can use the width for it
I do .css width
Tiago Correia
@tiagocorreiaalmeida
@AdelMahjoub any idea?
Adel
@AdelMahjoub
@tiagocorreiaalmeida you want those same spans to get a width or you want a real progress bar ?
@tiagocorreiaalmeida first you need a height for those spans, span is an inline element,
@tiagocorreiaalmeida or set them to display block, in any case they need a height and a background color
Tiago Correia
@tiagocorreiaalmeida
that's all defined mate