How do I concatenate a string with a javascript variable inside a jquery selector?
If I execute the code below. All the other form elements gets hidden.
var inputatr = $('input[type=text]').attr(); //button
$('input[value=string ' + inputatr +']').hide(); //textbox
Update
<?php for($x=0; $x<4; $x++){ ?>
<input type="text" id="<?php echo $x; ?>" name="<?php echo $x; ?>" value="text<?php echo $x; ?>"/>
<input type="button" name="show<?php echo $x; ?>" value="string<?php echo $x; ?>"/></li>
<?php } ?>
Are you trying to locate all your textboxes and hide the one with the value of
'string'? If so, the way to do that is actually something more like this:Updated because of your update: