JavaScript, getting value of a td with id name

后端 未结 8 1484
难免孤独
难免孤独 2020-12-01 02:53

Originally I was using input with an id and grabbing it\'s value with getElementById. Currently, I\'m playing with s. How can I grab the values of the

8条回答
  •  广开言路
    2020-12-01 03:18

    Again with getElementById, but instead .value, use .innerText

    Chicken
    document.getElementById('test').innerText; //the value of this will be 'Chicken'
    

提交回复
热议问题