Prakash

Prakash

  • NA
  • 258
  • 77.3k

mvc

May 18 2015 7:55 AM
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)