I want to select the following three values from the HTML file either by Jquery or Javascript.
- class "class1" href value
- class "class1" inner text value (PersonA in the example code)
- class "Title" inner text value (Accountant in the example)
How can I select all the data of li node by node as? I am lost :(
<ol id="result-set">
<li id="v-0">
<div class="result-data">
..
<h2>
<a class="class1" href="">PersonA</a>
</h2>
<dl class="basic">
<dt>Title</dt>
<dd class="title">Accountant</dd>
....
</dl>
</div>
</li>
<li id="v-1">
...
</li>
.....
classA? I only seeclass1. You can get "Accountant" via several ways, a safe approach would be to be specific in using selectors. One approach is this:$('#result-set li#v-0 dl.basic dd.title').html()