jquery - Retrieve text of nested div inside a div -



jquery - Retrieve text of nested div inside a div -

i have html

<div onclick="get_nested_value"> <div class="inner_div"> hello </div> <div>

now want jquery function this

function get_nested_value() { alert($(this.'.inner_div').text()); }

where this.'.inner_div' must point class inner_div

but must have been doing silly syntactical error.

any suggestion?

try this:- in html:-

<div onclick="get_nested_value(this)"> <div class="inner_div"> hello </div> <div> function get_nested_value(e) { alert($(e).find('.inner_div').text()); }

jquery

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -