Need help selecting an element from a jquery response

Need help selecting an element from a jquery response

Hey Guys,

 I am trying to get the value of a hidden input element from a jquery ajax response. The default value for the hidden element is  0. But after the jquery post has been completed the hidden input value attribute gets changed to a different number(by php)

For some reason when I select the element from the data var (the response variable) and pass it into the html() function, it shows the value as 0 for the hidden input

Below is my code... any help would be really appreciated!

   
  1.            $.post(url,obj_param)
  2.                .done(function (data) {
  3.                    console.log(data);
  4.                    var thread_id = $("#thread").html(data);
  5.                    console.log(thread_id);
  6.                });
  7.          }

Here is a snippet of my html code

   
  1.     <section class="message_form">
  2.         <form action="http://localhost/GuruCoders/index.php/messages/NewMessageThread/index" class='msg_form' id='59' method="post" accept-charset="utf-8">
  3.         <div id="err_msg"> Please enter a message to send </div>
  4.         <textarea name="msg" class="msg" id="59" cols="30" rows="10"></textarea>
  5.         <br>
  6.         <input type="submit" name="send" value="Send">
  7.         </form>
  8.        <!-- The value returns as 0 not 55 -->
  9.         <input type="hidden" id="thread" value="55" name="thread"/>
  10.     </section>