How do I use JavaScript variables as a parameter in a jQuery selector?
<script type="text/javascript">
$(function(){
$("input").click(function(){
var x = $(this).attr("name");
$("input[id=x]").hide();
});
});
</script>
<input type="text" id="bx"/><input type="button" name="bx"/>
<input type="text" id="by"/><input type="button" name="by"/>
Basically what I want to do is to be able to hide the element which has an id that is equal to the name of the element that is being clicked.
OR you can do something like this.
OR you can give some effect also.
If you want to remove the entire element permanently form the page.
You can also use it in this also.