Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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