开发者

jQuery equivellent for dynamically create id

开发者 https://www.devze.com 2023-03-19 19:50 出处:网络
I am looking for jQuery equivellent for the following. Please help. var request = document.getElementById(\'request_\' + id1)

I am looking for jQuery equivellent for the following. Please help.

var request = document.getElementById('request_' + id1)
var response = document.getElementById('response_' +开发者_JS百科 id1); 
modifyText(request.firstChild.nodeValue,response.firstChild.nodeValue);


Try

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


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

精彩评论

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