I have a bit of trouble finding the right solution for what I'm trying to do. I have a table:
var _1 = "Something1";
var _2 = "Something2";
var result = "dsadas";
$('<tr><td>' + _1 + '</td><td>' + _2 + '</td><td>' + result + '</td></tr>').appendTo('#test');
td {
border: 1px solid black;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table class="gr">
<thead>
<tr>
<th>Something1</th>
<th>Something2</th>
<th>Result</th>
</tr>
</thead>
<tbody id="test">
<tr>
<td>Something1</td>
<td>Something2</td>
<td>32</td>
</tr>
</tbody>
</table>
Run codeHide resultI push him as shown above.
And when I dynamically add a new element, I want to check if the table contains values of the im columns inserted into the table, and: If not, click new, if there is, just change the result column. How can I archive this?
source
share