jquery 根据属性选择元素总结

用到哪写到哪,记录备忘

1、根据元素属性选择代码如下:

$("span[id='"+ currentDevice + "']")

2、元素属性以特定字符开始的写法:

$("input[id^='news']") 

3、元素属性以特定字符结束的写法:

$("input[id$='news']") 

猜你喜欢

转载自blog.csdn.net/u013558123/article/details/88680311
今日推荐