Cannot create a div tag using document.createElement('div'); In JavaScript

<!DOCTYPE html>
    <meta charset="utf-8">
    <title> </title>
     <script src="" >
    <input type="button" name="add" value="ADD DIV" onclick="addRow();"/>
    <p id="content">


<script type="text/javascript">
      function addRow(){
       var div=document.createElement('div');
       console.log("CRETING DIV"+div);
       div.innerHTML = ` <input type="text" name="name" value="" />
                         <input type="text" name="value" value="" />
                          <input type="checkbox" name="check" value="1" /> Checked?
                         <input type="button" value="-" onclick="removeRow(this)" /> `;
                    console.log("after creting the  DIV "+div);


when I am using the create element to create the DIV tag, it does not create the tag rather shows in the console [object HTMLDivElement]

Also, the appendChild(‘div’) does not says
RemoveDIVtagUsingJS.php:27 Uncaught TypeError: Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node’

I don’t know why my document.createElement(‘div’); is not working.What to do?

41 thoughts on “Cannot create a div tag using document.createElement('div'); In JavaScript”

  1. Pingback: cialis canada