How can I solve "TypeError: Object doesn't support property or method 'append'" in IE11?

Viewed 2324

My code like this :

  setFooter () {
    if (!this.footer) {
      const div = document.createElement('div')
      let html
      html = "<span><div style='float:left; border-radius: 12px;'></div></span>" +
          "<span style='font-size:12px'>Available</span>"
      div.innerHTML = html
      document.querySelector('.v-date-picker-table').append(div)
      this.footer = true
    }
  }

I had search in google and I get reference to add variable. In my code I had add variable. You can see const and let. But why there exist error? In the chrome and firefox browser, it works

2 Answers

In JavaScript DOM is no append method.. use appendChild instead... it depends to your DOM tree

Related