This will be a silly question, just trying to figure my way around Javascript functions interacting with HTML forms and can't get it to work.
Extremely simple, put it in a fiddle
$('#test').submit(function(){
var battery = $('#battery').value();
$('#output').text(battery);
});
<form id="test" action="">
<fieldset>
<label for="battery">Cell Count</label><br />
<input type="number" size="3" name="battery" id="battery" /><br />
<input type="submit" name="submit" id="submit" onclick="submit()" />
</fieldset>
</form>
<div id="output">
</div>
Always returns an error and I can't figure out why. Have played around with and other things, can't get it to work always error.