开发者

jquery - Trigger an element based on a constructed ID?

开发者 https://www.devze.com 2023-02-19 00:07 出处:网络
In IE6, I\'m using jQuery to trigger a click of another link on a page whose ID is derived from the ID of another field, plus some text, in this case text, but it doesn\'t work.

In IE6, I'm using jQuery to trigger a click of another link on a page whose ID is derived from the ID of another field, plus some text, in this case text, but it doesn't work.

var targetElm = $(this).attr('id') + 'Searc开发者_运维问答h';
alert(targetElm);
$(targetElm).trigger('click');


Make sure you put a # before the value of targetElm; jquery won't match an id without it.

0

精彩评论

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