Skip to content

Instantly share code, notes, and snippets.

@hendrahc
Created April 24, 2016 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hendrahc/032edaa998c546a1d1990e87b28ccdc5 to your computer and use it in GitHub Desktop.
Save hendrahc/032edaa998c546a1d1990e87b28ccdc5 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script src="https://cdn.socket.io/socket.io-1.2.1.js"></script>
<script>
$(function(){
var socket = io.connect('http://10.10.104.191:3000');
$('#mainan').on('input change',function(){
socket.emit('changePrice',$(this).val());
});
$('#sendprice').on('click',function(){
socket.emit('changePrice',$('#inputtext').val());
});
});
</script>
</head>
<body>
<br><br>
<h1>Input Text</h1>
<input id="inputtext" type="text" value="" />
<input id="sendprice" type="button" value="Submit" />
<h1>Silakan tulis semaunya</h1>
<input id="mainan" type="text" value="" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment