1 Replies - 404 Views - Last Post: 30 September 2012 - 06:19 PM

#1 fabrivera99  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 17
  • Joined: 27-January 12

Create an element and adding.

Posted 30 September 2012 - 09:44 AM

I'm trying to create an Element and adding it to a <DIV>
<script type="text/javascript">
            function ImageFM() {
                //alert('test');
                document.getElementById("IMG1").src = "images/fm.png";
                
                var PHYMLHY = document.createElement("Button");
                document.body.appendChild(PHYMLHY);
            }
       </script>
I already create it and add it to the body but I dot know how to add it to a DIV tag. I try to google it but there is no topic that has the answer for that.
Thanks :)

Is This A Good Question/Topic? 0
  • +

Replies To: Create an element and adding.

#2 ThrowsException  Icon User is offline

  • D.I.C Head

Reputation: 33
  • View blog
  • Posts: 83
  • Joined: 21-February 12

Re: Create an element and adding.

Posted 30 September 2012 - 06:19 PM

are you trying to add the button to a div instead of the body?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1