title: Send button value by post request via jquery
body: <p>My code</p>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;form&gt;
  &lt;button id="test" value="123" name="test" &gt;ok&lt;/button&gt;
  &lt;/form&gt;
  
  &lt;script&gt;
  
  
   $(document).ready(function () {
            $("#test").click(function() {
                     var combinedData = $("#test").serialize();
                   $.post(
                          "element_submit.php",
                          combinedData
                   ).done(function(data) {
                          //alert("Successfully submitted!");
                          $("#result").html(data);
                   }).fail(function () {
                            //alert("Error submitting forms!");
                   })
            });
          });
  
  &lt;/script&gt;
  
  
  
  &lt;div id="result" &gt;&lt;/div&gt;
  </code></pre>
  
  <p>The <strong>element_submit.php</strong> file </p>
  
  <pre><code>&lt;?php 
  
  //just to test it should output in the #result div 
  echo $_POST['test'];
  
  ?&gt;
  </code></pre>
  
  <p>What I am trying to do is submit the <strong></strong> with the <strong>value="attribute"</strong> so the data is serialized and send the post request, it's not like a  submit when user insert a value and submit,What I need is to get the value attribute and submit to the php, this code is only for To simplify and illustrate what I am trying to do, because in this page I have the following buttons with ids #follow #unfollow so I need a way to get the button value to make the user follow and unfollow.</p>