Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to put click event on multi input of a same class
    primarykey
    data
    text
    <pre><code> &lt;script type="application/javascript"&gt; $(document).ready(function() { $('input#newcommentinput').click(function() { $(this).hide(); $(this).parent('.commentplaceofnewmodernpost').children('.newcommenttableinnewmodernpost').show(); $('.textreaofnewcommentinnewmodernpost').focus(); }); $("input.postnewcomment").click(function() { var message=$(this).parent('.newcommenttableinnewmodernpost').children('.textreaofnewcommentinnewmodernpost').val(); var post_id=$('.textreaofnewcommentinnewmodernpost').attr('id'); alert(message); if(message.length &gt; 0){ $.post("PAGE_TO_POST", {comment:""+message+"",post_id:""+post_id+""}, function(data){ if(data.length &gt;0) { $('#newcommenthere').append(data); $('table.newcommenttableinnewmodernpost').hide(); $('input.inputofnewcommentinnewmodernpost').show(); $('textarea.textreaofnewcommentinnewmodernpost').val(''); $('input.inputofnewcommentinnewmodernpost').val('Click to post comment...'); } });} }); }); &lt;/script&gt; &lt;div class="commentplaceofnewmodernpost"&gt; &lt;input class="inputofnewcommentinnewmodernpost watermarkpostcomment" id="newcommentinput"&gt; &lt;table class="newcommenttableinnewmodernpost"&gt; &lt;tr&gt; &lt;td class="imgtdofnewcommenttable"&gt; &lt;img src=" IMG_ SRC" class="imgofdisplaycomment"&gt; &lt;/td&gt; &lt;td style="vertical-align:top;"&gt; &lt;textarea class="textreaofnewcommentinnewmodernpost watermarkpostcomment newcommenttextareaexpand" autocomplete="off" title="Click to post comment" id="POST_ID"&gt;&lt;/textarea&gt; &lt;input type="button" class="greenbutton postsubmitbutton postnewcomment" value="Comment" title="Post comment" alt="Post comment" style="padding:5px 10px;margin-top:5px;" id="postnewcomment"&gt; &lt;input type="button" class="normalbutton postsubmitbutton" value="Cancel" title="Close to post comment" alt="Close to post comment" style="padding:5px 10px;margin:5px 0 0 15px;" id="cencalnewcomment"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; </code></pre> <p>This is my HTML Code. When some body click in input id="newcommentinput" then hide this input and showing the table after it and also focusing after it. AND when click on button id="postnewcomment" then it post the message to another page display result and hide table and showing previuos input. </p> <p>How to do this with jquery?</p> <p>Now i am using the above jquery code to implement the above statement...</p> <blockquote> <p>REMEMBER: there are multi div in page so write your answer for multi selection .</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload