Hide element from DOM in jQuery

Last Reply one month ago By pandeyism

Posted one month ago
Dear All,
I am new to Jquery, Please help me.
I need to remove the text 'Commercial' and 'Government' from the DOM HTML.
I have tried with the below code, It did not work 


Posted one month ago

Share your html and javascript code.

Posted one month ago

Hi bhadriau,

Refer below sample.


<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
    $(function () {
        if ($("#lblCommercial").text() == 'Commercial') {
<label><input type="radio" id="chkCommercial" /><span id="lblCommercial">Commercial</span></label>
<br />
<label><input type="radio" id="chkGovernment" /><span id="lblGovernment">Government</span></label>