回答編集履歴

2

コメント追加

2017/05/10 00:39

投稿

root_jp
root_jp

スコア4666

test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  $('.icon').each(function() {
4
4
 
5
- var iconObj = $(this);
5
+ var iconObj = $(this); // 各要素に処理を行う。
6
6
 
7
7
  var iconVal = iconObj.attr('value');
8
8
 

1

インデント修正

2017/05/10 00:39

投稿

root_jp
root_jp

スコア4666

test CHANGED
@@ -2,23 +2,23 @@
2
2
 
3
3
  $('.icon').each(function() {
4
4
 
5
- var iconObj = $(this); // 各要素に処理を行う。
5
+ var iconObj = $(this);
6
6
 
7
- var iconVal = iconObj.attr('value');
7
+ var iconVal = iconObj.attr('value');
8
8
 
9
- if (iconVal <= 200 && iconVal >= 1) {
9
+ if (iconVal <= 200 && iconVal >= 1) {
10
10
 
11
- iconObj.addClass('icon_bg_red');
11
+ iconObj.addClass('icon_bg_red');
12
12
 
13
- } else if (iconVal <= 400 && iconVal >= 201) {
13
+ } else if (iconVal <= 400 && iconVal >= 201) {
14
14
 
15
- iconObj.addClass('icon_bg_blue');
15
+ iconObj.addClass('icon_bg_blue');
16
16
 
17
- } else if(iconVal >= 401){
17
+ } else if(iconVal >= 401){
18
18
 
19
- iconObj.addClass('icon_bg_green');
19
+ iconObj.addClass('icon_bg_green');
20
20
 
21
- }
21
+ }
22
22
 
23
23
  });
24
24