The example in this article describes how to implement DIV container assignment using JS. Share it with everyone for your reference, the details are as follows:
Assign a js function to a DIV container, used in ajax, supporting IE and Firefox
<script> function setValueForDiv(id,content) { var element = document.getElementById(id); element.innerHTML = unescape(content); if(!element.innerHTML) { try{ element.innerHTML = unescape(content); }catch(e){} } } </script>
where id is the id of the div
content: for content
Call example:
<div id="title"> </div> setValueForDiv(id,content) <script> setValueForDiv("title","this is a test"); </script>
I hope this article will be helpful to everyone in JavaScript programming.