Home > Software engineering >  I want to get what is written in the title from within the html table
I want to get what is written in the title from within the html table

Time:02-02

here's my code:

 <td ><div  data-toggle="tooltip" title="7f5e5b03-7d30-4001-acd9-c993d6c24301">ETTN</div></td>

I want to get what is written in title instead of ETTN, (with loop). How can i do that?

enter image description here

CodePudding user response:

Here's how you would get and write the value of EETN title with javascript.

eetn_divs = document.querySelectorAll(".eetn")

for (var i= 0, len = eetn_divs.length; i < len; i  ) {
    value = eetn_divs[i].getAttribute('title');
    eetn_divs[i].innerText = value
}
  •  Tags:  
  • Related