Change label text using JavaScript

前端 未结 8 1174
后悔当初
后悔当初 2020-11-27 04:39

Why doesn\'t the following work for me?



        
8条回答
  •  悲哀的现实
    2020-11-27 05:04

    Use .textContent instead.

    I was struggling with changing the value of a label as well, until I tried this.

    If this doesn't solve try inspecting the object to see what properties you can set by logging it to the console with console.dir as shown on this question: How can I log an HTML element as a JavaScript object?

提交回复
热议问题