I have one question. Could I write HTML code width a document.write()?
For example:
document.write("<br>");
I want to write "<br>" as a string in a Browser.Thanks a lot. :c-smile:
document.write("<br>");
I want to write "<br>" as a string in a Browser.|
|
|
document.write('hi[B]<br/>[/B]hi');
<div id="modifier">Hello world</div>
<script type="text/javascript">
document.getElementById('modifier').innerHTML = "Hello world<br />";
</script>However the "br" is actually an element. You could create and append it.
<script type="text/javascript">
document.getElementById('modifier').innerHTML = document.createElement('br');
</script>
function onLoad(){
document.getElementById('divtowriteID').innerHTML = 'Hi i am CodeCaller';
}
<body onload="onLoad">
gokuajmes said:
function onLoad(){
document.getElementById('divtowriteID').innerHTML = 'Hi i am CodeCaller';
}
<body onload="onLoad">
<body onload="onLoad">work on ie6?
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript
0 members, 1 guests, 0 anonymous users