I am wanting to update a css attribute using jQuery but it isnt working. Using the alerts in the code below my first alert brings up
url("file:///H:/Web/example/HTML/images/red-arrow-up.png")
but then the second alert (in the if statement) brings up
[object Object]
But what i want it to do is update the attribute and change up to down in the url. Any idea what im doing wrong?
$(document).ready(function() {
$( ".portlet-header" ).click(function() {
var currValue = $(this).children(".portlet-arrow").css("background-image");
alert (currValue)
if ($("currValue:contains('up')")) {
var newValue = $(currValue.replace("up", "down"));
alert(newValue)
$(this).children(".portlet-arrow").css("background-image", newValue)
};
if ($("currValue:contains('down')")) {
var newValue = $(currValue.replace("down", "up"));
alert(newValue)
$(this).children(".portlet-arrow").css("background-image", newValue)
};
});
});