开发者

why wont this jquery work?

<div style="width:600px;">
<p id="web" >Web </p>
<p id="webd" >description of web based services and what not more stuff more 开发者_StackOverflowstuff more stuff 
more stuff more stuff more stuff more stuff more stuff 
more stuff more stuff more stuff more stuff 
more stuff more stuff more stuff more stuff 
more stuff more stuff more stuff more stuff 
</p>
</div>



<script>
  $("#web")click(function () {
    alert('You clicked');
    $("#webd").slideToggle("slow");
  });

</script>

I have this jquery code that im trying to run, the lquery lib are included but it just refuses to run. what am i doing wrong ? found it ! there was a dot missing... this has been fing with me all day !!!


$("#web")click(function () {

should be

$("#web").click(function () {

?


You have a syntax error at $("#web")click. It should be $("#web").click


I don't believe the <p> tag offers a click event. You probably want to do a mouseup event.


You're missing the "." (dot) after "$('#web')" --- right before the click() call.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜