Combining Two jQuery .val() Results Into Variable
I'm sure this is fairly elementary; however, I just can't get it to work. It's a two step process. First, I want to combine the values of two dropboxes into a string. Second step, I need to display any ID field found in a table row that matches that string. Here are the two lines of code; however, something is not quite working out for me yet. Any help would be greatly appreciated!
var $result = $('#provider').val() + $('#grade').val(); $('tr[id*=\"$result\"]').show();
The problem isn't combining the variables — the string concatenation should be just fine.
var result = $('#provider').val() + $('#grade').val(); $('tr[id*="' + result + '"]').show();
$('tr[id*="' + $result + '"]').show();