How can I hide the contents of a li without it being displayed by pressing inspect in a browser?

0

I hide a <li style="display:none"> but clicking on inspect in a browser allows me to see its contents. I want that content not to be displayed when I click on inspect.

    
asked by sebamim 14.06.2018 в 16:23
source

1 answer

1

For this you could use Jquery with the function: remove

My html:

<ul>
  <li class="list">Rusia</li>
  <li class="list">Mexico</li>
  <li class="list">España</li>
</ul>

Removing the li:

$('.list').each(function(){
$(this).remove()
});

This eliminates the li completely without being seen by the browser inspector.

Note .- In this case I use a css class called list to identify and delete them .. adapt this code to your needs by id, class, tag ..

Check here

I hope I help you!

    
answered by 14.06.2018 / 16:42
source