I'm trying to get the first and second elements inside a div. But I can not.
I want to get the two inputs inside the shipping_table . And by clicking on the inputs they will do a function.
HTML is:
<table class="table" id="shipping_table"> <tr style="cursor:pointer">
<td style="width:16px;">
<label class="radio">
<input type="radio" id="s2ba82f8be158554d1aefa1fd27ea9001" data-deliverytime="13" value="PAC|27.8|13" name="shipping_method" checked="checked"> </label>
</td>
<td onclick="toggle_shipping('s2ba82f8be158554d1aefa1fd27ea9001');" style="width:120px;">
PAC </td>
<td onclick="toggle_shipping('s2ba82f8be158554d1aefa1fd27ea9001');">
<strong>R$ 27,80</strong><br><span class="label label-info">Entrega em torno de 13 dias úteis</span> </td>
</tr>
<tr style="cursor:pointer">
<td style="width:16px;">
<label class="radio">
<input type="radio" checked="checked" id="s527db0b075ea188067f95de4b5ab90e2" data-deliverytime="5" value="SEDEX|72.9|5" name="shipping_method"> </label>
</td>
<td onclick="toggle_shipping('s527db0b075ea188067f95de4b5ab90e2');" style="width:120px;">
SEDEX </td>
<td onclick="toggle_shipping('s527db0b075ea188067f95de4b5ab90e2');">
<strong>R$ 72,90</strong><br><span class="label label-info">Entrega em torno de 5 dias úteis</span> </td>
</tr>
And the Javascript is:
$("#shipping_table input:eq(1)").click(function() {
alert( "função aqui" );
});
$("#shipping_table input:eq(2)").click(function() {
alert( "função aqui" );
});
I do not have much experience with Jquery. So if you can help I thank you.