javascript - Changing input element value in the fly -


I am trying to create a voting system. So when the user clicks on the "vote" button, I want to display the counting count, which reflects the count in real time.

I am using a code such as

HTML

  & lt; Div square = 'left' & gt; & Lt; Input id = 'vote' name = 'vote-rate' type = 'button' value = '1' / & gt; & Lt; / Div & gt;   

javascript

  $ Ajax ({type: "POST", url: "vote.php", data: datapass, cache: wrong, success: function {html} {$ ("# votes"). Val () = count;}});   

I am using the input button to display the vote because I think that I get the button value using jQuery .val () The vote is going to be easy now), then the momentum is increased when a user votes it and displays the scope of the vote by setting a new value as the value of the button.

However, the T-value seen for working does not update after setting it. Can anyone tell me that what is the best way to display ballot in real time?

Value is syntax

  $ ("# votes"). Val (count);    

Comments