javascript - How To Hide Div Elements when Inspect Element? - Stack Overflow

i have a validator like this,checkAmount: function(){if(){true$("#a").removeClass("d-n

i have a validator like this,

        checkAmount: function(){

            if(){
                //true
                $("#a").removeClass("d-none");
            }
            else{
            //false
                $("#a").addClass("d-none");
            }

        }

but when I inspect the div element it still appears like this

<div id="a" class="col-md-7 offset-md-5 d-none"></div>

and I can easily remove the d-none class that was used for validation

The question is how do I hide the div when it is false so that I can't inspect the element?

i have a validator like this,

        checkAmount: function(){

            if(){
                //true
                $("#a").removeClass("d-none");
            }
            else{
            //false
                $("#a").addClass("d-none");
            }

        }

but when I inspect the div element it still appears like this

<div id="a" class="col-md-7 offset-md-5 d-none"></div>

and I can easily remove the d-none class that was used for validation

The question is how do I hide the div when it is false so that I can't inspect the element?

Share Improve this question asked Jul 24, 2019 at 4:59 MisdanMisdan 1531 gold badge6 silver badges15 bronze badges 1
  • You can't do like that because you can't handle developer tools functionality – Ankur Commented Jul 24, 2019 at 5:02
Add a ment  | 

3 Answers 3

Reset to default 5

To remove html from your DOM

 $("#a").remove();

if you want to hide only then use

$("#a").hide();

$("DOM").hide(); can be used to hide element

$("DOM"). remove(); can be used to remove element which u can't see in browser inspect element

$("DOM").hide();

you can use this hide method to hide elements

$("DOM").remove(); 

you can remove method to remove any hidden inspects elements

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744967782a4603787.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信