Не корректно работают задания в веб разработке №2.
В первом задании, пока имя id не поменял код не компилировался.
Во втором задании при запуске ругается на 53 строчку, а код состоит из 35, ставлю как требуется в задании строку:
button.css(“background-color”, “goldenrod”);
И не выполняется.
Посмотрел на ютубе как проходят, у них всё без проблем работает, как так то?!
var image = $("#theImage"); // Finds #theImage.
image.css("background-color", "red"); // Changes it.
// Set the image's "width" to "200px" and press Run:
image.css("width", "200px");
/* CSS should be written inside tags. */
body {
text-align:center;
}
Работает, если заменить id :
var image = $("#atheImage"); // Finds #theImage.
image.css("background-color", "red"); // Changes it.
// Set the image's "width" to "200px" and press Run:
image.css("width", "200px");
/* CSS should be written inside tags. */
body {
text-align:center;
}
2 Задание:
var button = $("#theButton");
// This function will run when the button is clicked.
function buttonClicked() {
// This sets the button's text color to "blue".
button.css("color", "blue");
// Set the button's "background-color" using .css()
button.css("background-color", "goldenrod");
}
// ".on()" is used to hook an event to an element.
// Now, the button will run the buttonClicked...
// ... function when "click"ed.
button.on("click", buttonClicked);
/* Remember only CSS rules go inside tags. */
body {
text-align:center;
}
#theButton {
width: 500px;
height: 125px;
font-size: 3em;
}
I'm a button.