I can't seem to be able to understand this, i have this code inside an each
loop :
$('#prices_table tbody tr:last').children().eq(2).val("Y U NO WORK?!");
Now the above code does't work, yet if i try setting text or html it does appoint the right and changes the text, however setting the value seems to not work.
Needles to say that the specific element is a text input.
I saw in this question that the author seemed to be able to make it work with addressing the attr of the element, meaning :
$('#prices_table tbody tr:last').children().eq(2).attr("value","Y U NO WORK?!");
But that didn't work either. I have no errors on my page, any idea what could be the problem?
I should mentioned then the addressed element is being created by clone 1 line above using :
$('#prices_table tbody tr:first').clone(true).appendTo('#prices_table').show();
In case it matters, and this is the html of the element :
<input class="itext product_prices_inputs" type="text" name="prices[]" value="0"/>
And my code runs inside a (document).ready
.
Since much of my code is generated with PHP, this is the outputed HTML of the specific tr
:
<tr style="">
<td>
<select class="iselect pricelist_products_select" name="pricelist_product[]" >
//very big select
</select>
</td>
<td class="product_price">85</td>
<td>
<input class="itext product_prices_inputs" type="text" name="prices[]" value="0">
</td>
<td>
<a href="#" class="delete_price">delete</a>
</td>
</tr>