selector id jquery but is variable

JavaScript
//<p id="id-1"></p>
var id = 1;
$('#id-' + id).hide();
Source

Also in JavaScript: