Can someone work createElement into this script to demo its use?
I think the two can work together, but I don't know how.
<html>
<head>
<script type="text/javascript">
function myFunction(anid)
{
var cssatr = document.getElementById(anid).getAttribute('style'); // get the value of "style"
var htmlanid = document.getElementById(anid).innerHTML; // get html code
return ('css style = '+ cssatr+ '<br>html = '+ htmlanid);
}
</script>
</head>
<body>
<div id="anid" style="float:right;">
Some html code
</div>
<script type="text/javascript">
document.write(myFunction('anid'))
</script>
</body>
</html>