Problem with button click event in jquery -


I'm using jQuery Click Button to click on div but I do not know why it is not working. .

HTML:

  & lt; Input type = "button" id = "addmoresg" value = "add more" name = "button" & gt; & Lt; Div id = "addsg" style = "display: none" & gt; & Lt ;! - More HTML here - & gt; & Lt; / Div & gt;   

Javascript:

  $ (document) .ready (function () {$ ('. Addmoresg'). Do (function () {$ ('. Addsg'). Show ("slow");});});   

jsfiddle demo:

I can not find any results on the button click.

2 problems:

  1. You as a library in your demo JQuery is not selected.
  2. Use ( .addmoresg ) instead of ( #addmoresg ) in your elements only id S, not class es:

      input type = "button" id = "addmoresg" value = "add more" name = "button" & gt;   

    $ ('. Addmoresg)' elements to class = "addmoresg" , such as

      & Lt; Input type = "button" class = "addmoresg" value = "add more" name = "button" & gt;     

    with jQuery instances is a great one and one.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -