In html, label does not have a value attribute.
Like div and most other html elements, it has innerText and innerHTML attributes
Cannot document.getElementByID("test").value="chenhuang ";
should be the following
<labelid="test"></label> document.getElementById(test).innerText=""; <divid="test"></label> document.getElementById('test').innerHTML="";
For more js methods of assigning values to label tags and div tags, please pay attention to the PHP Chinese website for related articles!