<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Create Div Element Dynamically using JavaScript</title>
    <style type="text/css">
        .classA
        {
            color: #999;
            padding: 10px;
            width: 250px;
            height: 150px;
            background-color: #fafafa;
            font-size: 12px;
            font-family: verdana;
            border: solid 1px #666;
        }
    </style>
    <script type="text/javascript" language="javascript">
        function CallDiv() {
            var divTag = document.createElement("div");
            divTag.id = "divDyn";
            divTag.className = "classA";
            divTag.innerHTML = "Welcome to <b>aspxtutorial.com</b> ";
            document.body.appendChild(divTag);
        }
        window.onload = CallDiv();
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input id="btClick" type="button" value="Click" onclick="CallDiv();" />
        <br />
    </div>
    </form>
</body>
</html>
