I'm using jQuery .val() to pull data results out of a form that contains two sets of radio buttons.
<!DOCTYPE HTML>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function userPrefsSubmitted() {
console.log( $('form input[@name=cssOn]:checked').val() );
console.log( $('form input[@name=halfFramesOn]:checked').val() );
}
</script>
</head>
<body>
<p>Choose User Prefs</p>
<form>
<p>Transitions</p>
<div><input type="radio" name="cssOn" value=true>True</div>
<div><input type="radio" name="cssOn" value=false>False</div>
<p>Half Frames</p>
<div><input type="radio" name="halfFramesOn" value=true>True</div>
<div><input type="radio" name="halfFramesOn" value=false>False</div>
<br/><br/>
<input class="submitButton" type="button" onClick="userPrefsSubmitted()" value="tap when done" />
</form>
</body>
</html>
If I choose fasle then true and hit the button the console.log shows false false
This is driving me nuts and I've search this forum as well as interwebs but not found an answer. Where am I going wrong?