How to change HTML content with javascript after the POSt method
===

I have troubles to change content in my HTML document with javascript after submitting a form with a POST method. I need to change the color of a div inside my HTML document to yellow, I have already done it, but the problem is that after it changes to yellow then the HTML website gets refreshed in the navigator and then it goes back to normal(white). It kind of flashes the yellow and then goes to white again.

Here is my HTML code:

    <form action="" method="post" onSubmit="return changeColor()">
    .
    .
    .
    <div id="divColor">
    .
    .

And this is my javascript code to change the div color:

    function changeColor()
    {
		var div = document.getElementById("courselist");
		div.style.backgroundColor='yellow';
    }


I need to do it this way because is part of the assignment, so I cannot change the color with CSS and so far we can only use HTML and javascript. This is not the whole assignment in case somebody thinks I want to cheat, this is the part that I am stucked with. I cannot make the div keep the yellow color after the navigator has refreshed the HTML website after the POST method.

Thank you!


