Edit: Based on your comment below, you would use this:
$('#one img.'+id)
In your question you have a space between img
and the .class
, I've simply removed that so you get img.className
or img.'+className
With the introduction of template literals in ECMAScript 2015, you can also do
$(`#one img.${id}`)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…