using a string for selector

using a string for selector

Hello. Thanks in advance for any help!

I can use $('p#T1') to select the <p> tag with an id of 'T1'. How would I select that <p> tag if 'T1' were a string?

In other words, I'm passing 'T1' into the following function:

function displayitems (myItem) {
     // in this case myItem is 'T1'
     // I then need to 'select' the <p> tag with the 'T1' (myItem) id.
}


Thanks again for any help.