开发者

Prototype $ and $$ with special characters

开发者 https://www.devze.com 2022-12-29 00:57 出处:网络
Is there anyway by which i can use the $ or $$ utility selectors with arguments containing special characters?

Is there anyway by which i can use the $ or $$ utility selectors with arguments containing special characters?

<div id="my example">

$('my example')

<div class="item1\item2">

$$('div.item1\item2')

I've tried开发者_如何学编程 using the standard escape sequence \ but am having no luck.


Arguments to those functions can contain ids of elements. As the spec says:

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

This implies that special characters within ids are not allowed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号