jQuery相当于动态创建id

时间:2011-07-11 04:50:11

标签: javascript jquery

我正在寻找以下jQuery equivellent。请帮忙。

var request = document.getElementById('request_' + id1)
var response = document.getElementById('response_' + id1); 
modifyText(request.firstChild.nodeValue,response.firstChild.nodeValue);

2 个答案:

答案 0 :(得分:4)

尝试

var request = $('#request_' + id1)
var response = $('#response_' + id1); 
modifyText(request.find(':first-child').text(),response.find(':first-child').text());

答案 1 :(得分:1)

var request = $('#request_' + id1);
var response = $('#response_' + id1);