So for those who can't wait fiddle
I am developing something like this and I am just new in the world of jQuery :) My problem is how do I enable and disable the clicks of the <i> element when I click the disable and enable buttons below :) Thank you so much for your answers. I would really appreciate it.
Preview Code:
HTML
<ul class="controls">
<li><i class="fa fa-pencil" data="a1"></i></li>
<li><i class="fa fa-trash" data="a2"></i></li>
<li><i class="fa fa-align-justify" data="a3"></i></li>
</ul>
<span class="disable">Disable</span>
<span class="enable">Enable</span>
CSS
.controls{
list-style: none;
}
.controls li{
display: inline-block;
margin: 0px 5px;
}
.controls li i{
cursor: pointer;
}
.disable,
.enable{
margin: 10px;
background: #000;
color: #fff;
padding: 3px 5px;
cursor: pointer;
}
JS
$(document).ready(function(){
$('.controls li i').click(function(){
alert($(this).attr("data"));
});
});