So I have the following
<div id="myscore"><div>
<input type="text" name="score" id="score" />
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#click').click(function(){
$('#myscore').get('computescore.php', $('#score').val(); )});
});
<div id="click"> <a href="#">click</a> </div>
The code will not pick up the value of score. How do you get the value of an input field into the a jquery function?
It updates the myscore field with the computed score after the score has been entered and clicked.
assuming
computescore.phpjust returns a single value, change:to
you have to use a callback-function. take a look at the documentation for more information.