I need to change div background-image with linear-gradient from Javascript Please try to correct below codings:
<script>
function abc1(){
var pos = document.getElementById("test");
pos.style.background-image="linear-gradient(to right,
#85e085 0%,
#85e085 90%,
#ff9999 0%,
#ff9999 10%);";
}
</script>
<body>
<div id="test" style="background-image: linear-gradient(to right,
#85e085 0%,
#85e085 50%,
#ff9999 0%,
#ff9999 50%); width:200px;">dsfhdh2346346</div>
<input type=button value="CHANGE" onClick="abc1();">
</body>
pos.style.backgroundImage- notice the camel casing, changingbackground-imagetobackgroundImage