Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

A part of my string as below,

sString= "<TABLE style="BORDER-BOTTOM-COLOR: #000000; BORDER-LEFT: 1px solid; WORD-WRAP: break-word; TABLE-LAYOUT: fixed; BORDER-TOP: 1px solid; BORDER-RIGHT: #000000 1px solid" id=tbMeal_0 class=tdBorder cellSpacing=0 cellPadding=2 width="100%">
<TBODY>
<TR style="DISPLAY: table-row" id=trMeal_0_0 class=bgWhite>

<TD style="BORDER-BOTTOM: #000000 1px solid; BORDER-TOP-COLOR: #000000; BORDER-TOP-WIDTH: 1px; BORDER-LEFT-COLOR: #000000; BORDER-LEFT-WIDTH: 1px; BORDER-RIGHT: #000000 1px solid" align=right><SELECT style="WIDTH: 98%; DISPLAY: none; FONT-FAMILY: Verdana; FONT-SIZE: 11px" id=drpFoodItem1_0_0 jQuery111102613539446968628="23"><OPTION value=0>---Select Item---</OPTION><OPTION title="Balvenie Scotch Whiskey" selected value="Balvenie Scotch Whiskey">Balvenie Scotch Whiskey</OPTION><OPTION title=Qweer value=Qweer>Qweer</OPTION><OPTION title=rineesh value=rineesh>rineesh</OPTION><OPTION title=test value=test>test</OPTION><OPTION title="test accohol" value="test accohol">test accohol</OPTION><OPTION title=Tre value=Tre>Tre</OPTION><OPTION title=Wine value=Wine>Wine</OPTION></SELECT><SPAN class=ui-combobox jQuery111102613539446968628="66"><SPAN class=ui-helper-hidden-accessible role=status aria-live=polite></SPAN>

<INPUT style="WIDTH: 981px" id=drpFoodItem_0_0 class="ui-widget ui-widget-content ui-corner-left ui-combobox-input ui-autocomplete-input" onkeyup="KeyUpOnFoodItem('0_0',event);" onclick=OnChangeMealTime(0); value="Balvenie Scotch Whiskey" autocomplete="off" jQuery111102613539446968628="26"><BUTTON aria-disabled=false class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-corner-right ui-button-icon ui-combobox-button" title="" role=button tabIndex=-1 type=button jQuery111102613539446968628="50"><SPAN class="ui-button-icon-primary ui-icon ui-icon-triangle-1-s"></SPAN><SPAN class=ui-button-text></SPAN></BUTTON>

<UL style="DISPLAY: none" id=ui-id-1 class="ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all" tabIndex=0 jQuery111102613539446968628="33"></UL></SPAN>


</TD>..."



I want to remove the input tag with id 'id=drpFoodItem_0_0' from the above string.How to solve.

by using this
XML
sString = sString.replace(/<\/?INPUT[^>]*>/g, "");
removing all input tag. but i want to remove some specific input tag.


Thanks..
Posted
Updated 20-Jun-14 0:13am
v2

1 solution

Remove using id:
C#
<script type="text/javascript">
        $(document).ready(function () {
            $("#btn_hideFoodItem").click(function () {   //e.g.on button click using jquery            
                $("#drpFoodItem_0_0").remove();
                return false;
            });
        });
</script>
 
Share this answer
 
v2

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