I need to grab the text value of a child div.
A B> 8条回答 甜味超标 (楼主) 2021-02-04 02:53 Simple, var text_val = $('#second_child').text(); Or your change, var text_val = $('#first').children('#second_child').text(); This will return "B" from div of id "second_child" UPDATE Changed the second solution to children() instead of nextAll(). 0 讨论(0) 查看其它8个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
Simple,
var text_val = $('#second_child').text();
Or your change,
var text_val = $('#first').children('#second_child').text();
This will return "B" from div of id "second_child"
UPDATE Changed the second solution to children() instead of nextAll().
children()
nextAll()