Hello- I want to create Dynamic DIV elements without using innerHTML.
Here s the code that I am currently working with:
<script language="Javascript">
var i=1;
function creatediv()
{
mNewObj = document.createElement( div );
mNewObj.id = "BOX" + i;
mNewObj.style.backgroundColor="red"
mNewObj.innerText = "Box " + i;
document.getElementById(tid).appendChild(mNewObj);
alert(mNewObj.innerText);
i++;
}
</script>
<div id="tid">ghjghk</div>
<form method="post">
<input type="button" value="Create Box" onclick="creatediv()">
</form>
It does not create DIV elements when I click the button. Please help!!!
I am unable to see your full answers. Yahoo displays a partial code and displays "...."
So please email your code to sundaripaul [at] yahoo [dot] com.
Thank you.
while I m trying to open youtube file I get a massege that my javascript is turne off. any idea how I open it?
it says i either have JavaScript turned off or have an old version of adobe flash player
idk how to turn on javascript on firefox
and when i try to download the flash player it says i have to close firefox... i did it and tried again but it still didn t work.
i ve also tried restarting the computer. and the same thing happens on my laptop too
it works on internet explorer but not firefox
Is there any special way I should write javascript w/ Internet Explorer because Javascript is working w/ Safari & Firefox- but on my computer Internet Explorer isn t able to even do document.write. And I ve checked- javascript is enabled.
Since XHTML does not allow the "name" attribute- I changed
<img src="jpgs/about_off.jpg" name="about_button" /> to
<img src="jpgs/about_off.jpg" id="about_button" />
Now my rollover images don t work. Any ideas?
<a href="about.html"
onmouseover="document.about_button.src= jpgs/about_on.jpg "
onmouseout="document.about_button.src= jpgs/about_off.jpg ">
<img src="jpgs/about_off.jpg" id="about_button" /></a>
No comments:
Post a Comment