I try to get the switch value with $("input[@name=login]") , but I get the error "Unexplored syntax, unrecognized expression".
See http://jsfiddle.net/fwnUm/ and here is the full code:
<fieldset data-role="controlgroup" data-theme="z" data-type="horizontal" > <input type="radio" name="login" id="radio-signin" value="signin" checked="checked" /> <label for="radio-signin">Signin</label> <input type="radio" name="login" id="radio-register" value="register" /> <label for="radio-register">Register</label> </fieldset> $(document).ready(function() { $("input[@name=login]").change(function(){ alert($("input[@name=login]:checked").val()); }); });
simon source share