I have a problem. I want to make server do something after clicking on button. This is my HTML code:
<input name="like" id="like" value="Like" type="submit" />
<script>
$('like').click(function(){
$.post('/test')
});
</script>
and this is my server-side code:
app.post('/test', function (req, res) {
console.log('works');
});
And it doesn't work.
$('#like').click(function(){instead of$('like').click(function(){