Thursday, September 10, 2015

Div visible if..else Condition checking in jQuery

<script type="text/javascript">
if ($('div[id*=dvExistingImage]').is(":visible")) {

      alert('Existing');

   };
  if ($('div[id*=dvNewImage]').is(":visible")) {

        alert('New Image');

   };
if ($('div[id*=dvaddinapp]').is(":visible")) {

      alert('Add-in App');

   };
</script>
<div id="dvExistingImage" style="visibility:hidden">hi</div>

<div id="dvNewImage" >hi</div>
<div id="dvaddinapp" style="visibility:hidden">hi</div>

No comments:

Post a Comment