Sorry if this is a very simple question for you folks.

I have a master form and a content form.

I want to create an element (p) and add some text to it and display it on the content form (not on the master form). With the current code, it always displays on the Master form. I want it to display the newly created p element on the master form.

This is how the content form looks like:

Content Form:

Code:
<%@ Page Title="" Language="C#" MasterPageFile="~/QRMDMS.Master" AutoEventWireup="true" CodeBehind="Javascript_CreatingAndAddingElementsInForLoop.aspx.cs" Inherits="FHLBSF.QRMDMS.WebUI.Javascript_CreatingAndAddingElementsInForLoop" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<body>
    <p>assa/p>
    
    <script type="text/javascript" language="javascript">

        var varPelement = document.createElement("p");
        
        document.body.appendChild(varPelement);
        
        varPelement.appendChild(document.createTextNode("Hello Basam"));
        
        
    </script>
</body>
</asp:Content>
Master Form:
Code:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="QRMDMS.master.cs" Inherits="WebUI.DMS" %>

<!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></title>
  


    
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
  
</head>
<body>
    <form id="form1" runat="server">
    
  
     <table width="100%" class="maintable">
   
        
        <tr>
                        
            <td class="style6"  valign="top" bgcolor="PapayaWhip">
                 <asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1" 
                     onselectednodechanged="TreeView1_SelectedNodeChanged" 
                     ImageSet="Arrows" Font-Bold="False" Font-Names="Courier New" 
                     ForeColor="Black" border="solid dimgray">
                     <SelectedNodeStyle BorderStyle="Dotted" />
                </asp:TreeView>
                <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
       
            </td>
            <td class="style5"  valign="top">
                <asp:ContentPlaceHolder ID="MainContentPlaceHolder" runat="server">
        
                </asp:ContentPlaceHolder>
            </td>
        </tr>
              
        </table>  
    
   
    
    </form>
</body>
</html>