Correct answer:
$("[id=yourID]").doSomething()
for any code like
<textarea id="yourID" /> <img id="yourID" /> <div id="yourID" />
yes, I know this is not true html, but note that middle-class developers often have to solve problems that were made "better" by developers. See, for example, Microsoft SharePoint, where several identifiers are very common. And we cannot tell our customers what Microsoft did wrong, so we cannot help them. We tell them that Microsoft did it poorly, so we should help them :-)
efkah
source share