I want to disable this:
<a href="javascript:void(0);" role="button" onclick="edit_user('<?php echo $data['user_id']; ?>')"><i class="glyphicon glyphicon-pencil"></i>
when user_id = 1. Can someone help me?
答案 0 :(得分:2)
您可以在php中查看$ user_id == 1并回复您需要的代码
{{1}}
答案 1 :(得分:0)
<button type="button" onclick="edit_user('<?php echo $data['user_id']; ?>')" <?php echo $data['user_id']==1 ? 'disabled' : ''; ?>>Click Me!</button>