samedi 26 août 2017

How can innerHTML be in a conditional

I was working on filtering a table alphabetically and ran into a problem. I don't understand the x.innerHTML>y.innerHTML concept in this code:

 table = document.getElementById("myTable");
 rows = table.getElementsByTagName("TR");

  x = rows[1].getElementsByTagName("TD")[0];
  y = rows[2].getElementsByTagName("TD")[0];
  //check if the two rows should switch place:
  console.log(x.innerHTML.length, y.innerHTML.length)
  console.log(x.innerHTML>y.innerHTML);

So my question is how can innerHTML of something be in a conditional st.

Aucun commentaire:

Enregistrer un commentaire