Can I set the value for rendered attribute of h:commandLink from JavaScript?
<h:commandLink id="profileLink" rendered="#{bean.enable}">
                No. The rendered attribute is for the server side, not for the client side. In plain HTML/JS in the client cide you can just toggle the CSS display property.
// Get element by client ID.
var element = document.getElementById('formid:buttonid');
// Hide it.
element.style.display = 'none';
// Show it.
element.style.display = 'inline'; // or 'block' if it's a HTML block element
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With