My app read DOM object's attribute value. I want this value to be swapped with some new texts and put back to attribute. The original value is:
"position: absolute; background-image: url(\"http://dealer.raymarine.com/Views/Public/ShowImage.ashx?partno=M81203&view=thumb\")";
but when it should be updated with JS replace method, but nothing is changed, why?
Updating JS code:
var styleValue = ui.helper[0].getAttribute("style");
styleValue.replace("raymarine", "XXX");
styleValue.replace("ShowImage", "ShowImageSystemCreator");
styleValue.replace("view=thumb", "view=png");
ui.helper[0].setAttribute("style", styleValue);
console.log("draggable after text swap: " + styleValue);