innerHTML is not hiding in javascript validation
<pre><code>function editvalidation() {

    var isDataValid = true;

    var currentCourseO = document.getElementById("currentCourseNo");
    var newCourseNoO = document.getElementById("newCourseNo");

    var currentCourseMsgO = document.getElementById("currentAlert");
    var newCourseMsgO = document.getElementById("newAlert");


    if (currentCourseO.value == "") {
        currentCourseMsgO.innerHTML = "Please Select a Course to edit from the Course Drop Down Menu";
        newCourseMsgO.innerHTML = "";
        isDataValid = false; 
    } else {
        currentCourseMsgO.innerHTML = ""; 
    }


    if (newCourseNoO.value == "") {
        newCourseMsgO.innerHTML = "Please fill in the Course ID in your Edit";
        isDataValid = false;
    } else {
        newCourseMsgO.innerHTML = ""; 
    }


    return isDataValid;

}
</code></pre>

<p>Hi, in the code above what I am trying to do is that if the <code>currentCourseO.value == ""</code> is met, then display its string message but do not display the string message for <code>newCourseMsgO</code>.</p>

<p>If <code>currentCourseO.value == ""</code> is not met then display the string for <code>newCourseMsgO</code> which is <code>newCourseMsgO.innerHTML = "Please fill in the Course ID in your Edit";</code> if this validation is met.</p>

<p>At the moment it is not hiding the string for <code>newCourseMsgO</code> when <code>currentCourseO.value == ""</code> is met. Can I please have answer in javascript please.</p>
