while exploring jQuery I came up with the following weird script. I don't see myself doing this really however concatenating strings to achieve a variable name is not unusual in JavaScript.
Any feedback welcome.
...
<script type="text/javascript">
var a = 'y';
$(document).ready(function() {
$('p[id^=' + $('p[id=x]').html() + a + "]").css('color','blue');
});
</script>
...
<p id="x">2a</p>
<p id="2ay_">mytext</p>