开发者

jquery - Trigger an element based on a constructed ID?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜