bonaca bonaca - 1 year ago 52
Javascript Question

How to get content of a child div?

Why this doesn't work:

<div class="store" id="vframestore">


var a = $("#vframestore").children[0].html;

error: Uncaught TypeError: Cannot read property 'html' of undefined

Answer Source

You can do it like following.

var a = $("#vframestore").children().first().html();


var a = $("#vframestore div").eq(0).html();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download