欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jQuery特殊符號(hào)轉(zhuǎn)義的實(shí)現(xiàn)

 更新時(shí)間:2016年11月30日 08:56:20   投稿:jingxian  
下面小編就為大家?guī)?lái)一篇jQuery特殊符號(hào)轉(zhuǎn)義的實(shí)現(xiàn)。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧

我們?cè)谑褂胘query選擇器的時(shí)候 對(duì)一些ID屬性中有特殊符號(hào)的地方需要進(jìn)行轉(zhuǎn)義。

列舉部分如下:

<input id="entity.username" type="text" value="hello" />
alert($("#entity\\.username").val());

<input id="entity:username" type="text" value="hello" />
alert($("#entity\\:username").val());

//中間是空格
<input id="entity username" type="text" value="hello" />
alert($("#entity\\ username").val());

<input id="entity[username]" type="text" value="hello" />
alert($("#entity\\[username\\]").val());

以上這篇jQuery特殊符號(hào)轉(zhuǎn)義的實(shí)現(xiàn)就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論