[jQuery] Unable to select input by value with variable
Hello,
I have a form with lots of radio buttons that all have the same name.
I want to select the one that was clicked by its value. What I am
doing is this:
<script type="text/javascript">
$(document).ready(function() {
$('input[name="weAreAllCalledTheSame"]').click(function () {
if ($(this).attr('checked')) {
iwasclicked = $(this).attr('value');
alert ($('input[@value=iwasclicked]').length);
alert (iwasclicked);
};
});
});
</script>
The variable iwasclicked has shows the value of the selected radio
button. But I am not able to select the input element by its value
with this variable: $('input[@value=iwasclicked]')
I hope you can help me and I am not too blind and stoopid.
Thx
Dirk