I have a button as follows:
<a href="#" onclick="AddRow();return false;" class="btnA">ADD</a>
Once I click the button, it adds a row to a #dataList1. Then I want it to be hidden. And I did following in Javascript;
<script type="text/javascript">
function AddRow(){
var tr = '<tr>';
tr += '<td></td>';
tr += '<td><span class="br"><input type="text" id="grpNm" name="grpNm" value="" style="width:96%"/></span></td>';
tr += '<td><span class="br"><input type="text" id="grpExp" name="grpExp" value="" style="width:96%"/></span></td>';
tr += '</tr>';
$('#dataList1').append(tr);
};
$('#AddRow').on('click', function(){
$('#AddRow').hide();
});
</script>
It adds the row, but after it, it does not hide the button. Where did I do wrong?
$('.btnA').css('display', 'none');<JAVASCRIPT>from the beginning of your title. Don't put tags in the title. (Do you see anyone else putting tags in the title?)jquerytag on the question.