jquery selector id with variable code example Example: selector id jquery but is variable //<p id="id-1"></p> var id = 1; $('#id-' + id).hide();