jquery - data value of input button inside a form -


Shows two forms with the input button, how do I get the value of the input button?

  & lt; Link rel = 'stylesheet' href = 'css / nook.css' type = 'text / css' media = 'screen, projection' /> & Lt; Script type = "text / javascript" src = "js / jquery-1.10.2.min.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ("post_comment") Submit (function (e) {e.preventDefault (); var s = $ ("comment"). Data ('I'); alert (S);});}) & lt; / Script & gt; & Lt ;? For Php ($ i = 0; $ i & lt; 2; $ i ++) {resonant "
"; Echo; & Lt; Div & gt; Input ";}? & Gt;

You must search the input element Which is inside the submitted form

  $ (document) .ready (function () {$ (".post_comment"). Submit (function (e) {e.preventDefault (); var S = $ (this) .find (". (". "); Data ('I'); Alert (s); var value = $ (this) .Finded (" Comment "). Val (); Alert (Value);});})  

There is a spelling mistake in your markup, should be class = 'commment' class = 'comment ' - There are 3 alert ()

/ P>

div>

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -