Hi, I am attempting to learn Javascript to help myself modify my forum. I have set myself what I consider to be a basic first task to see if I understand correctly. My basic task is to change all items of class="page-title" to the colour red. I tried the code below and it only worked for the "edit signature" tab on the signature page of the Profile. There are other occurrences of "page-title" on the other profile tabs before and after but only the signature page title is red. I looked at the value of y and it returns 1, so why is it not returning more than 1 when there are more occurrences of "page-title"? Â My Javascript is installed all pages.
Thankyou for any help you can give.Â
$(function() {
var x = document.getElementsByClassName("page-title");
var y=x.length;
var i;
for (i=0; i<y; i++) {
x[i].style.color="red";
}
});
Thankyou for any help you can give.Â
$(function() {
var x = document.getElementsByClassName("page-title");
var y=x.length;
var i;
for (i=0; i<y; i++) {
x[i].style.color="red";
}
});
Last edited by Dollymixture on Sat 25 Mar - 4:24; edited 1 time in total