Update InnerHTML

[Total: 0    Average: 0/5]

This shows how to update a DIV’s html on the fly.

Body Code:

<script>

var isIE=document.all?true:false;
var isNS4=document.layers?true:false;
var isNS6=navigator.userAgent.indexOf("Gecko")!=-1?true:false;

function doIt(_objName,_stuff)
{
  var _obj=null;
  if(isIE||isNS6)_obj=document.getElementById(_objName);
  if(_obj)
  {
    _obj.innerHTML=_stuff;
  }
}
</script>
<div id=myid>
STUFF IN OBJECT
</div>

<HR>
<form name=exf1>
<textarea name=ta1>THIS IS IN THE FORM</textarea>
<BR>
</form>
<a href="javascript:doIt('myid',document.exf1.ta1.value)">Change Value</a>

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *