开发者

JQuery SHow Hide clarifcation please

开发者 https://www.devze.com 2023-03-21 08:01 出处:网络
I\'ve a following div: <div id=\"someDIV\" style=\"display: none\"> bla开发者_开发技巧 bla bla

I've a following div:

<div id="someDIV" style="display: none">
  bla开发者_开发技巧 bla bla
</div>

I've a jquery as below:

 $(document).ready(function () {
   if (condition==true)
   {
     $("#someDIV").show();
    }
 };

For some reason someDiv is not showing up if condition is true. Am I doing something weird here, please?

Thank you.


You are missing a closing paren: ). With it added before your last semicolon, your code works fine.

$(document).ready(function () {
   if (condition==true)
   {
     $("#someDIV").show();
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消