Question: When I use hide and confirm in html. The hide is not working properly in Chrome only. When the confirmation window is shown, the "aa" element is not hidden. IE and FF is working fine.  

Any kind of suggestion is appreciated.

```
<html>
<head>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
</head>
<body>
    <a id='aa' href='javascript:hideit();'>try it</a>
    <script type='text/javascript'>
        function hideit() {
            $('#aa').hide();
            if (!confirm('hide?')) {
                $('#aa').show();
                return;
            }
            $('#aa').show();
        }
    </script>
</body>
</html>

```

Answer: 
please check this link Here is the working fiddler link [element hide on alert](https://jsfiddle.net/neeraj692/24c3vtkL/1/)
it's not working StackOverflow editor.

```html
<html>
<head>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
    <a id='aa' href='javascript:hideit();'>try it</a>
    <script type='text/javascript'>
        function hideit() {
            $('#aa').hide();
            setTimeout(function () {
                if (!confirm('hide?')) {
                    $('#aa').hide();
                    return;
                }
            }, 100);
        }
    </script>
</body>
</html>
```
Please check following code, it works properly in all browsers :

```
 <html>
 <head>
 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" >
 </script>
 </head>
 <body>
      <a id='aa' href='javascript:hideit();'>try it</a>
      <script type='text/javascript'>
           function hideit() {           
               if (confirm('hide?')) {
                 $('#aa').hide();                
               }
              else
              {
                $('#aa').show();
              }
           }
     </script>
</body>
</html>

```

Thanks...