Now question is - how to pass content to element which ID I’ve just calculated?
<script type="text/javascript">
$(document).ready(function() {
$("input[@class=votepictures]").click(function() {
$(this).attr("disabled","disabled");
var a = $(this).attr('id');
var results = 'picturesresults' + a; // THIS IS TARGET ID
$(#results).text('new results'); // This hellish thing doesn't work =(
alert(results);
});
});
</script>
<input type="button" class="votepictures" id="12" name="plus" value="vote +">
<span class="picturesresults" id="picturesresults12" >picture 12 results</span>
<input type="button" class="votepictures" id="23" name="minus" value="vote -">
<span class="picturesresults" id="picturesresults23" >picture 23 results</span>
P.S. Of course I know I can replace $(#results).text(‘new results’); with usual document.getElementById(results).innerHTML = ‘new results’; - but it’s not too good…