HTML content from:
<type= "text/html" ID= "thetemplate"> <id= "input_id" type= "text"/> Initialize HTML content in this script tag </script>
After the page is loaded, take out the HTML contents of the script tag and append into the body, then execute the following code
var numelem = document.getElementById (' input_id '); Here is the DOM element node that can find input, but it may not be the same as the normal DOM element node numelem.value = "AA"; Here you will find that no matter how you set it the value will not change on the page console.log (numelem.value); What's even more strange is that you'll find that the output "AA" is the value you set in the previous step, but it doesn't show up on the page.
Using the Chrome browser to do the test, other browsers have not tried, this weird phenomenon should be because the HTML content is caused by the script tag export, do not know the browser is not counted as a bug
Question about JS cannot set input value