I need to change the color of background
, the color of the texts and the links of all the DIVs of a site .
I was able to do this in JavaScript with the following code:
<script type="text/javascript">
function altoContraste() {
var divs = document.getElementsByTagName("div");
var links = geral.getElementsByTagName("a");
for (var i = 0; i < divs.length; i++) {
divs[i].style.background= '#000';
divs[i].style.color= '#FFF';
}
for (var i = 0; i < links.length; i++) {
links[i].style.color = '#FF0';
}
}
</script>
But I need to do this using jQuery, I do not understand jQuery, but I researched in some places how to do it and I got to the following code:
<script>
$(".altoContrase").click(
$("div").each(function() {
$(this).css({
'background': '#000', 'color': '#FFF'
})
});
</script>
Why is it not working? What should I do to be able to do this? In the jQuery code I can not change the color of links .