Retrieving values from a table in HTML using jQuery?
- by Mo
Hi
i was just wondering whats the best way to retrieve the following labels and values from this HTMl code using jquery and storing them in to a array or hash map of some sort where i have for e.g "DataSet:" : "prod" or ["Dataset", "Prod"]?
<table id="metric_summary">
<tbody>
<tr class="editable_metrics">
<td><label>DataSet:</label></td>
<td><input name="DataSet" value="prod"></td>
</tr>
<tr class="editable_metrics">
<td><label>HostGroup:</label></td>
<td><input name="HostGroup" value="MONITOR-PORTAL-IAD"></td>
</tr>
<tr class="editable_metrics">
<td><label>Host:</label></td>
<td><input name="Host" value="ALL"></td>
</tr>
<tr class="editable_metrics">
<td><label>Class:</label></td>
<td><input name="Class" value="CPU"></td>
</tr>
<tr class="editable_metrics">
<td><label>Object:</label></td>
<td><input name="Object" value="cpu"></td>
</tr>
<tr class="editable_metrics">
<td><label>Metric:</label></td>
<td><input name="Metric" value="CapacityCPUUtilization"></td>
</tr>
thanks