Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am creating a dynamic file by asp.net
In this file there are two <ol> tag I want to remove inner <ol> tag when user runs this file. (on page load of HTML file)

What I have tried:

HTML
<script language='javascript'>
function CallPrint()
{document.getElementById('printpage').style.display='None';document.getElementById('closepage').style.display='None';window.print();document.getElementById('printpage').style.display = 'block';document.getElementById('closepage').style.display = 'block';}

</script>

<table class='ltr' align='Left' style='width: 750px; padding:15px; FONT-FAMILY: calibri; font-size:11pt;'>
<tr>
<td align='left'> 
<a href='#' id='printpage' onClick='CallPrint();'>Print</a><br>  
<a href='#' id='closepage' onClick='window.close();'>Close</a>

</td>
</tr>
<tr>
<td>
<br />
<br />
<p align='Left'><span style='font-size: 11pt; font-family: Calibri'> Date : 6 July 2017<br /><br /><p align='center'>Appoinment Letter </p>

 <tr>
 <td align='Left'>
 <p align='Left'>
 <span style='font-size: 11pt; font-family: Calibri'><br/ ><br/ >Mr. SUDESH PAL CHATHLI<br />1943/9 dummy text 
 <br />aaaaa,<br />U.P - aaaaaa<br /><br /><br />Dear xyz<br /><br />
 <p align='Left'>
 <span style='font-size: 11pt; font-family: Calibri'>dummy text  a position with dummy text . Ltd. as  dummy text  commencing  dummy text .<br /><br /> 
 <ol id="fst-ol" class="fst-ol">
	 <li style='font-size:11pt;font-family:calibri;'>dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text .
	 </li><br />
	 <li style='font-size:11pt;font-family:calibri;'>Your initial place of posting will be Bangalore dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text  .
	 </li><br />
 </ol>
 <ol>
	 <li>dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text 
	 </li>
	 <li>dummy text dummy text dummy text dummy text dummy text  dummy text dummy text dummy text dummy text dummy text 
			dummy text dummy text dummy text dummy text dummy text dummy text .
	 </li>
	 <li>bib</li>
	 <li><br /></li>
 </ol>
 </span>
 </p>
 </td>
 </tr>
 </table>
Posted
Updated 6-Jul-17 0:24am
v4
Comments
Suvendu Shekhar Giri 6-Jul-17 6:11am    
Can you please answer, why are you adding that if that is meant to be removed on the page load without any condition?

There are certainly ways to do this but knowing the actual requirement helps suggesting better approach.

1 solution

<ol>
   ....
</ol>
<asp:PlaceHolder visible="false" runat="server">
<ol>
    ....
</ol>
</asp:PlaceHolder>
 
Share this answer
 
Comments
arvindcis 6-Jul-17 6:29am    
i need list element element so I cant set visible =false
there is two orderd list thsts why output looking like that
1.abc
2.xyz
3.aaa

and
1.qqq
2.weqe
3.dfsd

If I will delete one internal ordered list then output look like that which I want

1.abc
2.xyz
3.aaa
4.qqq
5.weqe
6.dfsd
F-ES Sitecore 6-Jul-17 6:33am    
Google "remove element jquery" for examples or "remove element javascript" if you can't use jQuery. It's pretty straight forward.

You could also try to set it's style to "display:none;"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900