Baran Topal

Baran Topal


May 2024
M T W T F S S
« Feb    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories


some more JQuery

baranbaran

Long ago, I was trying to get a value of a td class and appending the value to a text field in jquery.

<table>
 <tr>
 <td class="test">This is a test</td>
 </tr>
</table>
<input type="text" id="myTextBox" />

$('td').click(function() {
 var myClass = $(this).attr('class');
 $('#myTextBox').val(myClass);
})