user4411221
user4411221

Reputation:

Hidden elements are getting visible by inspecting

I have changed the CSS of an element that is both display:none and visibility hidden by jQuery but when I inspect them they are getting visible. Why?

Upvotes: 2

Views: 6798

Answers (3)

dukemalik
dukemalik

Reputation: 38

If you don't want that element anymore on your view page then you should use ".remove()" method on that dom element.

If you want it to toggle in between show and hide without showing dom under inspection you can use ".empty()" to clear the content (or .remove() to remove them parmanetly) and add them later using ".html()". which will work in same way as display : none and display : inline without showing them while inspecting.

Upvotes: 1

Pavan
Pavan

Reputation: 655

Any Element, which is loaded in Dom can be visible by inspecting the Element. If you want to avoid showing the Visible hidden DATA in Dom, Then you need to handle from Server Side using php,node.js, jsp and other server side programing languages

Upvotes: 0

Snazzy Sanoj
Snazzy Sanoj

Reputation: 802

They are so because css is part of static website designing and 'Inspect element' option allows you modify client-side data the way you want it. If you want them to be hidden, try using more of server-side functions for 'not sending the hidden elements' rather than 'sending the elements and hiding them'.If you planning on using only css, there is no way around to get the job done.

Upvotes: 0

Related Questions