如何使用jquery获取以某种模式开头和结尾的文本框ID? [英] How to get textbox id which starts and ends with some pattern using jquery?

查看:82
本文介绍了如何使用jquery获取以某种模式开头和结尾的文本框ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在tabpanel中动态创建了文本框,并将特定ID设置为该文本框,但是当我尝试获取该文本框时,其ID会根据帐户和标签号的设置进行更改。



Texbox ID的格式为:



I have created textbox dynamically in tabpanel and set specific id to that textbox but while I trying to get that textbox its id get change according to setting for account and tab number.

Texbox id is made as:

"tcProperty_tab" + 0 + "_StreetName"
tcProperty_tab - static prefix to all controls
0              - tab number set according to tab
streetName     - static suffix





如何获得该文本框使用jquery匹配起始和结束模式> ???



How can get that textbox using jquery by matching starting and ending pattern>???

推荐答案

使用属性选择器...

https://api.jquery.com/category/selectors/attribute-selectors/ [ ^ ]

| = 用于前缀和
Use attribute selectors...
https://api.jquery.com/category/selectors/attribute-selectors/[^]
|= used for prefix and


= for suffix ...将它们组合起来并在'id'属性上使用它们......
= for suffix...combine them and use them on the 'id' attribute...


这篇关于如何使用jquery获取以某种模式开头和结尾的文本框ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆