I have jquery code. I want same think to do in javascript
//$('.checkme').attr('checked', true);
$('.checkme').click(function(){
if($('input[name='+ $(this).attr('value')+']').attr('disabled') == true){
$('input[name='+ $(this).attr('value')+']').attr('disabled', false);
}else{
$('input[name='+ $(this).attr('value')+']').attr('disabled', true);
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr>
<td>
<input type="checkbox" name="sd3" value="mfi_nam9" class="checkme"/></td>
<td>First Value </td>
<td > <input type="text" name="mfi_nam9" class="text required" id="mfi_name" disabled ></td>
</tr>
<tr>
<td>
<input type="checkbox" name="sd2[]" value="mfi_nam8" class="checkme" /></td>
<td>Second Value </td>
<td><input type="text" name="mfi_nam8" class="text required" id="mfi_name" disabled >
</td>
</tr>
</table>