First hi everyone.. i just wanted to make a simple website for a friend and i thougt to add some effect.. but jeah.. first i wanted only to change the background of one element but then this came across:
TypeError: $(...).style is undefined (in the Firefox Console)
HTML:
<!DOCTYPE html>
<html lang="DE">
<head>
<meta charset="utf-8"/>
<title>Laura Sack - Offizielle Webseite</title>
</head>
<body>
<div id="gallery-container" class="gallery-container cf"></div>
<script src="js/jquery.js"></script>
<script src="js/main.js"></script>
</body>
</html>
Javascript:
$(document).ready(function(){
$("#gallery-container").style.background = "black";
});
you are mixing javascript with jquery.
In jquery you have to use css() to make it work like this:
$("#gallery-container").css("background","black");
Try this,
$(document).ready(function(){
$("#gallery-container").css('background-color','black');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With