Answers for "Html.Java script div content value change using id"

0

Html.Java script div content value change using id

var targetDiv = document.getElementById('content');
    var htmlContent = '';

    function populateData(event){
      switch(event.target.value){
        case 'A':{
         htmlContent = 'Content for A';
          break;
        }
        case 'B':{
          htmlContent = "content for B";
break;
        }
      }
      targetDiv.innerHTML = htmlContent;
    }
Posted by: Guest on August-04-2021

Code answers related to "Html.Java script div content value change using id"

Code answers related to "Javascript"

Browse Popular Code Answers by Language