How to get value of a div using javascript

前端 未结 6 2132
情歌与酒
情歌与酒 2020-11-27 21:47

This is my div:

By Color

6条回答
  •  萌比男神i
    2020-11-27 22:23

    You can try this:

    var theValue = document.getElementById("demo").getAttribute("value");
    

提交回复
热议问题