Whenever I try to execute some JavaScript code on my XHTML JSF pages I get the following error:
Caused by: javax.el.PropertyNotWritableException: Illegal Syntax for Set Operation
<h:commandButton onclick="addTest()" styleClass="btn-primary" value="Add Test"></h:commandButton>
<div class="labTest"></div>
<script type="text/javascript">
function addTest()
{
$(document).ready(function(){
$(".labTest").html("<b>Hello world!</b>");
});
}
</script>
Now I am trying to populate the .labTest
div with some html code. Any help will be appreciated.