6
Answers

mvc

Akash Patil

Akash Patil

9y
488
1
hello...I want this(Below code) code in mvc view with javascript..below code can not work.plz help 
 
<script>
function ShowCorrectAnswer()
{
if (document.getElementById("correctAnswerHidden").value == "a" || document.getElementById("correctAnswerHidden").value == "A")
  {

  $('#optionA').css("background-color", "green");
  }
if (document.getElementById("correctAnswerHidden").value == "b" || document.getElementById("correctAnswerHidden").value == "B")
 
  {
  $('#optionB').css("background-color", "green");
  }

 if (document.getElementById("correctAnswerHidden").value == "c" || document.getElementById("correctAnswerHidden").value == "C") {
 
  $('#optionC').css("background-color", "green");
  }

if (document.getElementById("correctAnswerHidden").value == "d" || document.getElementById("correctAnswerHidden").value == "D")
{
$('#optionD').css("background-color", "green");
  }
}

</script>

Answers (6)