Friday, 15 July 2011

javascript - how to get value of dl tag HTML from jquery -



javascript - how to get value of dl tag HTML from jquery -

i want select next value html file either jquery or javascript. bank transfer, can 1 suggest me how can do.

<div class="color-me" id="txndetails"> <div class="panel-apply-font-size"> <div class="row"> <div class="cols"> <dl class="entitydetails-field"> <dt>paymentmethod</dt> <dd>bank transfer</dd> </dl> </div> <!--end of cols--> <div class="cols"> <dl class="entitydetails-field"> <dt>accountnumber</dt> <dd>34343</dd> </dl> </div> <!--end of cols--> <div class="cols"> <dl class="entitydetails-field"> <dt>bankname</dt> <dd>bank of america</dd> </dl> </div> <!--end of cols--> </div><!--end of rows--> </div><!--end of panel--> </div><!--end of color me-->

i doing this:

$("#txndetails dd").on(function(){ $(this).... });

here don't have class-names nor id tags given dt , dd elements, how can first dd tag pick it's text? want text of first dd tag value "bank transfer".

use

$('#txndetails dd:first').text()

or

$('#txndetails').find('dd').first().text()

javascript jquery html

No comments:

Post a Comment