Property ‘style’ does not exist on type ‘Element’

here the code function showTab(n) { // This function will display the specified tab of … Read more Property ‘style’ does not exist on type ‘Element’

here the code

  function showTab(n) {
  // This function will display the specified tab of the form...
  var x = document.getElementsByClassName("tab");
  x[n].style.display = "block";
  //... and fix the Previous/Next buttons:
  if (n == 0) {
    document.getElementById("prevBtn").style.display = "none";
  } else {
    document.getElementById("prevBtn").style.display = "inline";
  }
  if (n == (x.length - 1)) {
    document.getElementById("nextBtn").innerHTML = "Submit";
  } else {
    document.getElementById("nextBtn").innerHTML = "Next";
  }
  //... and run a function that will display the correct step indicator:
  fixStepIndicator(n)
}

I got error – Property ‘style’ does not exist on type ‘Element’.

How can fix this.

Source: CSS – Stack Overflow



Leave a Reply

Your email address will not be published. Required fields are marked *