+ 2

Fill in the blanks to change the background color of all span elements of the page.

var s = document. getElementsByTagName(" "); (var x=0; x<s.length;x++) { s[ ].style.backgroundColor = "#33EA73"; }

9th Sep 2017, 8:28 AM
Mahammadjon Abdusalomov
Mahammadjon Abdusalomov - avatar
6 Answers
+ 10
var s = document.getElementsByTagName("span"); for(var x=0; x<s.length; x++) { s[x].style.backgroundColor = "#33EA73"; }
9th Sep 2017, 8:58 AM
ChaoticDawg
ChaoticDawg - avatar
+ 4
Did you get this from the lessons? actually, you can see the comments in lessons to solve this, var s = document.getElementsByTagName("span"); for(var x=0; x<s.length;x++) { s[x].style.backgroundColor = "#33EA73"; }
9th Sep 2017, 9:03 AM
Ipang
0
var s = document. getElementsByTagName(" span "); for (var x=0; x<s.length;x++) { s[ x ].style.backgroundColor = "#33EA73"; }
23rd Mar 2018, 2:42 PM
Mahnoor Shahzad
Mahnoor Shahzad - avatar
0
var s = document. getElementsByTagName("span"); for(var x=0; x<s.length;x++) { s[x].style.backgroundColor = "#33EA73"; }
2nd Jul 2020, 6:39 PM
Rustamjon Kosimov
Rustamjon Kosimov - avatar
0
Thanks
1st May 2021, 4:35 PM
Mohammed Auwal Usman
Mohammed Auwal Usman - avatar
0
var s = document. getElementsByTagName(" span "); for (var x=0; x<s.length;x++) { s[ x ].style.backgroundColor = "#33EA73"; }
9th Aug 2021, 1:22 PM
Owethu Sotomela
Owethu Sotomela - avatar