Hide HTML Button before page load in jQuery

Last Reply 4 months ago By dharmendr

Posted 4 months ago

How to hide an HTML Button before the page loads using jQuery

Posted 4 months ago

Hi sathya2496,

Set the html button style attribute to display none. 

Then in document ready function show the button.

Check this example. Now please take its reference and correct your code.

HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#btnSave").show();
        });
    </script>
</head>
<body>
    <button id="btnSave" type="button" style="display: none;">Save</button>
</body>
</html>

Demo